|
|
I've shown this to Chris but I thought I should create a clear example scene.
The problem is that trace fails to work for objects that have no_image set and
which are also in a union. This problem exists in 3.6 as well. I think Rune
may have run into a similar problem in the past.
In the example, three objects are declared:
TestObject1: a sphere with no_image
TestObject2: a sphere with no_image, inside a union
TestObject3: a sphere without no_image, inside a union
In all cases the traces should intersect the declared test objects, but for the
second object (no_image, inside a union), it doesn't. I've made it so that the
scene displays a sphere for each test if trace returns an intersection (red for
the first, green for the second, blue for the third). As you can see, only the
red and blue spheres are displayed because the trace test on the second object
doesn't work.
Example scene:
light_source {<5,5,-5> 1}
camera {location <0,0,-6> look_at <0,0,0>}
#declare HitNormal = <0,0,0>;
#declare TestObject1 = sphere {<0,0,0> 1 no_image};
#declare TestObject2 = union {sphere {<0,0,0> 1 no_image}};
#declare TestObject3 = union {sphere {<0,0,0> 1}};
#declare HL = trace (TestObject1, <0,0,2>, <0,0,-1>, HitNormal); // works
#if (vlength(HitNormal) > 0)
sphere {<-2,0,0> 1 pigment {rgb x*1}}
#end
#declare HL = trace (TestObject2, <0,0,2>, <0,0,-1>, HitNormal); // doesn't work
#if (vlength(HitNormal) > 0)
sphere {<0,0,0> 1 pigment {rgb y*1}}
#end
#declare HL = trace (TestObject3, <0,0,2>, <0,0,-1>, HitNormal); // works
#if (vlength(HitNormal) > 0)
sphere {<2,0,0> 1 pigment {rgb z*1}}
#end
Cheers,
Lance.
thezone - thezone.firewave.com.au
Post a reply to this message
|
|