POV-Ray : Newsgroups : povray.general : Question for the Gurus Server Time
12 Aug 2024 21:21:16 EDT (-0400)
  Question for the Gurus (Message 11 to 13 of 13)  
<<< Previous 10 Messages Goto Initial 10 Messages
From: Josh English
Subject: Re: Question for the Gurus
Date: 31 Jan 1999 15:17:20
Message: <36B4B9D7.A53A745@spiritone.com>
I tried this code, just added a light and a camera and a background and it gave me a
bunch of
red sheres... perhaps 3.1 fixed whatever caused the original problem?

Josh English
eng### [at] spiritonecom


Spider wrote:

> Another one in the same style
> Here I'll declare some objects(This is untested, but I've had bad experiences with
this)
>
> try :
> #declare Sphere1 =
> union {
>   #local N = 50;
>   #while(N>0)
>     #local N = N -1;
>     sphere { <0,0,N>,.4 }
>   #end
> }
> #declare Sphere2 =
> union {
>   #local N = 50;
>   #while(N>0)
>     #local N = N -1;
>     object { Sphere1 translate <N,0,0> }
>   #end
> }
>
> #declare Sphere3 =
> union {
>   #local N = 50;
>   #while(N>0)
>     #local N = N -1;
>     object { Sphere2 translate <0,N,0> }
>   #end
>   pigment { colour rgb <1,0,0> }
> }
>
> This results in several Black spheres, why ?
>
> As I said, I'm not very sure of this case, but others I've met are like that, that
several
> unions withing eachother doesn't get a texture added..
>
> //Spider
>
> Ken wrote:
> >
> > If I have an object constructed using a CSG operation I get
> > two different results in the rendered object if I apply the
> > pigment and interior properties to the different pieces
> > versus the CSG as a single object ( see example ).
> > The difference is quite visible.
> >
> > Why ?
> >
> >  intersection{
> >    cylinder{x*-3,x*3,1
> >     pigment{rgbf<1,.7,.7,1>}
> >      interior{ior 1.95}
> >   }
> >
> >   plane{-z,-0
> >    pigment{rgbf<1,.7,.7,1>}
> >     interior{ior 1.95}
> >   }
> >  }
> >
> > vs.
> >
> >  intersection{
> >
> >  cylinder{x*-3,x*3,1}
> >
> >  plane{-z,-0}
> >
> >   pigment{rgbf<1,.7,.7,1>}
> >    interior{ior 1.95}
> >  }
> >
> > --
> > Ken Tyler
> >
> > tyl### [at] pacbellnet


Post a reply to this message

From: Ron Parker
Subject: Re: Question for the Gurus
Date: 1 Feb 1999 09:39:06
Message: <36b5bc8a.0@news.povray.org>
On Sat, 30 Jan 1999 07:14:23 -0800, Ken <tyl### [at] pacbellnet> wrote:
>If I have an object constructed using a CSG operation I get
>two different results in the rendered object if I apply the
>pigment and interior properties to the different pieces
>versus the CSG as a single object ( see example ).
>The difference is quite visible.

This is similar to the problem that used to exist when IOR 
was part of the texture.  POV keeps track of a stack of
pointers to interiors, and when it hits a face it knows
whether it is entering or exiting that object by checking
the stack to see if it's already inside that interior.
What does this mean?  Let's look at an example. 

Take the lens-shaped intersection of two spheres.  First, the
case where the two spheres have their own interiors, with
the same IOR, let's say 1.5.  the ray enters the lens through 
sphere 1 and gets refracted as though it were going from an
IOR of 1 to an IOR of 1.5, which is correct.  It then exits
through sphere 2, but because sphere 2 has a different 
interior from the one on the stack (distinct from sphere 1's 
interior, but with the same parameters) POV thinks it is now 
entering sphere 2. It tries to refract the ray commensurate 
with passing from an IOR of 1.5 to an IOR of 1.5, which has 
no net effect.  The result is POV now believes the ray is 
in two interiors and is traveling through a medium of IOR 
1.5, and it's not going in the direction you'd expect.

Now, the case where the interior applies to the object as
a whole:  The ray enters through sphere 1 and gets refracted
as before.  It exits through sphere 2, but this time POV
sees the same pointer and properly exits the sphere.  Since
it is now going from an IOR of 1.5 back to what it was (1)
it bends the ray appropriately and pops the interior from
the stack.

POV should probably issue a warning if an object with an 
interior is used in a CSG or is clipped, with the possible 
exception of union.


Post a reply to this message

From: Ken
Subject: Re: Question for the Gurus
Date: 1 Feb 1999 18:13:20
Message: <36B634EC.CE044BD0@pacbell.net>
Ron Parker wrote:
> 
> On Sat, 30 Jan 1999 07:14:23 -0800, Ken <tyl### [at] pacbellnet> wrote:
> >If I have an object constructed using a CSG operation I get
> >two different results in the rendered object if I apply the
> >pigment and interior properties to the different pieces
> >versus the CSG as a single object ( see example ).
> >The difference is quite visible.
> 
> This is similar to the problem that used to exist when IOR
> was part of the texture.  POV keeps track of a stack of
> pointers to interiors, and when it hits a face it knows
> whether it is entering or exiting that object by checking
> the stack to see if it's already inside that interior.
> What does this mean?  Let's look at an example.
> 
> Take the lens-shaped intersection of two spheres.  First, the
> case where the two spheres have their own interiors, with
> the same IOR, let's say 1.5.  the ray enters the lens through
> sphere 1 and gets refracted as though it were going from an
> IOR of 1 to an IOR of 1.5, which is correct.  It then exits
> through sphere 2, but because sphere 2 has a different
> interior from the one on the stack (distinct from sphere 1's
> interior, but with the same parameters) POV thinks it is now
> entering sphere 2. It tries to refract the ray commensurate
> with passing from an IOR of 1.5 to an IOR of 1.5, which has
> no net effect.  The result is POV now believes the ray is
> in two interiors and is traveling through a medium of IOR
> 1.5, and it's not going in the direction you'd expect.
> 
> Now, the case where the interior applies to the object as
> a whole:  The ray enters through sphere 1 and gets refracted
> as before.  It exits through sphere 2, but this time POV
> sees the same pointer and properly exits the sphere.  Since
> it is now going from an IOR of 1.5 back to what it was (1)
> it bends the ray appropriately and pops the interior from
> the stack.
> 
> POV should probably issue a warning if an object with an
> interior is used in a CSG or is clipped, with the possible
> exception of union.

That is a very reasonable explanation and it makes
sense even to me.

Thanks.

-- 
Ken Tyler

tyl### [at] pacbellnet


Post a reply to this message

<<< Previous 10 Messages Goto Initial 10 Messages

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