|
![](/i/fill.gif) |
Hello!
I'm wondering if there's a way to supply variables\values to a union object to
alter the way it is rendered. I'm not sure if I've worded that correctly, so
consider the code below. I'm trying to rotate the top box on the second figure,
but leave the first figure as-is. Is something like this possible or would I
need completely separate declarations for each "pose".
Thanks for any help you can offer.
-nip
Sample code:
#include "colors.inc"
#declare Tilted = 0.0;
#declare Figure = union {
box {
<0, 0, 0>, <1, 1, 1>
pigment { Green }
}
box {
<0, 0, 0>, <1, 1, 1>
pigment { Blue }
#if (Tilted > 0)
rotate z*15
#end
translate y*1
}
}
object { Figure }
object {
#declare Tilted = 1; //this does not make the right blue box rotate
Figure
translate <2, 0, 0>
}
camera {
location <5, 1, -5>
look_at <0, 1, 3>
}
light_source {
<5, 1, -5>
color rgb <1, 1, 1>
}
Post a reply to this message
|
![](/i/fill.gif) |