|
 |
Andy Cocker wrote:
>...
Snip --- 8< ---
> b) Any idea how I could make the floor using one isosurface, rather than a
> grid of many isosurfaces, as I have done here?
>...
I hope the code below solves this problem.
Experiment with the Xnr and Znr values (integers) to see how these
works. (Also see attached image.)
I think that it's possible to construct a "ReplikateFunction" that
also can generate grids of isosurfaces with an even number of "parts"
along each side.
Btw.:
You have a nice scene with interesting functions and patterns !
Regards,
Tor Olav
--
mailto:tor### [at] hotmail com
http://www.crosswinds.net/~tok/tokrays.html
// ===== 1 ======= 2 ======= 3 ======= 4 ======= 5 ======= 6 ======= 7
#version unofficial MegaPov 0.5;
#include "colors.inc"
global_settings { ambient_light color White }
// ===== 1 ======= 2 ======= 3 ======= 4 ======= 5 ======= 6 ======= 7
$ CM = color_map { [ 0 rgb 0 ] [ 1 rgb 1 ] }
$ CrackleFunction =
function { pigment { crackle form <1, 0, 0> color_map { CM } } }
$ OtherFunction = function { x^2 + y^3 + z^2 }
$ Xspacing = 5;
$ Zspacing = 4;
$ ReplicateFunction =
function {
OtherFunction(
(x + if(x, 1, -1)*Xspacing/2) % Xspacing - if(x, 1, -1)*Xspacing/2,
y,
(z + if(z, 1, -1)*Zspacing/2) % Zspacing - if(z, 1, -1)*Zspacing/2
)
}
$ Xnr = 3;
$ Znr = 2;
$ Gloop =
isosurface {
function {
ReplicateFunction(x, y, z)
+CrackleFunction(x*2, y*2, z*2)
-1
}
contained_by {
box {
-(<Xnr, 3.5, Znr> - <1, 0, 1>/2)*<Xspacing, 1, Zspacing>,
(<Xnr, 1.0, Znr> - <1, 0, 1>/2)*<Xspacing, 1, Zspacing>
}
}
max_gradient 6
accuracy 1E-6
}
object {
Gloop
pigment {
gradient 6*y
turbulence 0.5
color_map {
[ 0.0 color Blue + White ]
[ 0.5 color Blue ]
[ 1.0 color Blue + White ]
}
}
no_shadow
}
// ===== 1 ======= 2 ======= 3 ======= 4 ======= 5 ======= 6 ======= 7
background { color White }
light_source { 100*<3, 2, -1> color White }
camera {
location 5*< 1, 3, -5>
look_at < 0, -2, 0>
}
// ===== 1 ======= 2 ======= 3 ======= 4 ======= 5 ======= 6 ======= 7
Post a reply to this message
Attachments:
Download 'cracklequest01.jpg' (26 KB)
Preview of image 'cracklequest01.jpg'

|
 |