POV-Ray : Newsgroups : povray.beta-test : Bug with trace() and no_image objects in unions Server Time: 26 Sep 2020 08:44:11 GMT
  Bug with trace() and no_image objects in unions (Message 1 to 2 of 2)  
From: Lance Birch
Subject: Bug with trace() and no_image objects in unions
Date: 17 Feb 2006 07:26:21
Message: <43f57a9d$1@news.povray.org>
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

From: Chris Cason
Subject: Re: Bug with trace() and no_image objects in unions
Date: 17 Feb 2006 22:46:25
Message: <43f65241@news.povray.org>
I can confirm this is a bug in the CSG code, which is now fixed.

thanks for the report!

-- Chris


Post a reply to this message

Copyright 2003-2008 Persistence of Vision Raytracer Pty. Ltd.