POV-Ray : Newsgroups : povray.general : Question for the Gurus Server Time
12 Aug 2024 21:25:33 EDT (-0400)
  Question for the Gurus (Message 4 to 13 of 13)  
<<< Previous 3 Messages Goto Initial 10 Messages
From: PoD
Subject: Re: Question for the Gurus
Date: 30 Jan 1999 14:03:55
Message: <36B35796.5F1A@merlin.net.au>
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

I'll take a wild guess.

Perhaps in the first case when a ray hits the plane within the cylinder,
it is considered to be entering the plane with ior 1.95 and also
entering the cylinder with ior 1.95, so POV does something like multiply
the
iors.

In the second case, which is done 'correctly', the ray enters a single
CSG object with one ior and so POV
knows how to deal with it.

I say that the second example is correct because if the iors were
different the result would not represent
any real world situation.  The ior would be different depending upon
which face of the object a ray entered.

Cheers, PoD.


Post a reply to this message

From: Josh English
Subject: Re: Question for the Gurus
Date: 30 Jan 1999 14:09:36
Message: <36B359D8.AEDF5ED4@spiritone.com>
That sounds right... in the first example there is a small slice of the plane that is
causing a second application of the ior value... as in this example:

 cylinder { z*-3,z*0, 3
            pigment { rgbf <1,0.7,0.7,1> }
            interior { ior 1.95 }
          }

 cylinder { z*13,z*0, 1
            pigment { rgbf <1,0.7,0.7,1> }
            interior { ior 1.95 }
          }

when you render this you can see that the smaller cylinder is causing a similar
effect.

Josh

eng### [at] spiritonecom

Spider wrote:

> When you have the testure on the objects, adn do a intersection/difference, the
cutting
> objects material is applied ABOVE the base objects texture..
> I think this is what you see...
> (spoken in uncertanity)
>
> //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: Ronald L  Parker
Subject: Re: Question for the Gurus
Date: 30 Jan 1999 14:40:37
Message: <36b45e38.9973722@news.povray.org>
On Sat, 30 Jan 1999 09:07:31 -0800, Ken <tyl### [at] pacbellnet> wrote:

>  As I understand CSG operations when you intersect an object
>or group of objects, let's keep it simple and say a sphere
>intersected by a plane, the intersecting object adds it's
>properties to the object being intersected.

This is roughly correct.  I always find that it's easier
to visualize it exactly the way the code does it: a "face" 
of an object appears in an intersection if it is inside of 
every other object in the intersection, with the exception 
of the object it belongs to, of course.  All faces keep
whatever textures are assigned to them.  But I don't expect 
this to be clear to anyone else. :)

>  A sphere clipped by a plane will become hollow while a
>sphere intersected by a plane will have the surface of the
>plane added to the area bounded by the circumference of the
>sphere.

Another way to think of it is to say two objects that are
intersected are clipped_by each other.  That is,

intersection {
  plane {y,0 pigment {color Red}}
  sphere {y,2 pigment {color Blue}}
}

is roughly equivalent to

  plane {y,0 pigment {color Red} clipped_by {sphere{y,2}}}
  sphere {y,2 pigment {color Blue} clipped_by {plane{y,0}}}

>Certainly we are allowed to #declare an object without a pigment.
>We may use that object inside another #declared union of objects.
>And when the final #declare object, now a group of objects, is
>used the pigment and other material properties may be added.
>But it can also be accomplished at the individual object level.
>So there should be no difference. Or should there ?

There is a caveat: if a child of a CSG operation already has a
texture, it won't be affected by any texture that's applied to the
CSG object as a whole.


Post a reply to this message

From: Margus Ramst
Subject: Re: Question for the Gurus
Date: 30 Jan 1999 19:57:27
Message: <36b3aa77.0@news.povray.org>
Ronald L. Parker wrote:

>There is a caveat: if a child of a CSG operation already has a
>texture, it won't be affected by any texture that's applied to the
>CSG object as a whole.
>

Being lazy, I'll just ask without testing first...
If the texture applied to the CSG as a whole contains parts that the child
does not (for example a normal block), won't this be used in the child's
texture? And what about the case when both parent and child use a material
block, but the parent has an interior block and the child doesn't? Will the
child get it's parent's interior?
Sound's like a study in genetics, doesn't it?

Margus


Post a reply to this message

From: Spider
Subject: Re: Question for the Gurus
Date: 30 Jan 1999 21:06:19
Message: <36B3B97F.CAC1547A@bahnhof.se>
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: Ken
Subject: Re: Question for the Gurus
Date: 30 Jan 1999 21:46:13
Message: <36B3C3D4.B1A7F519@pacbell.net>
Ronald L. Parker wrote:
> >Certainly we are allowed to #declare an object without a pigment.
> >We may use that object inside another #declared union of objects.
> >And when the final #declare object, now a group of objects, is
> >used the pigment and other material properties may be added.
> >But it can also be accomplished at the individual object level.
> >So there should be no difference. Or should there ?
> 
> There is a caveat: if a child of a CSG operation already has a
> texture, it won't be affected by any texture that's applied to the
> CSG object as a whole.

I concure.
I carefuly avoided mixing my apples and oranges here.
I think I read about it somewhere in the Pov v1.0 docs :)

-- 
Ken Tyler

tyl### [at] pacbellnet


Post a reply to this message

From: Ronald L  Parker
Subject: Re: Question for the Gurus
Date: 31 Jan 1999 12:49:27
Message: <36b496e0.90026417@news.povray.org>
On Sun, 31 Jan 1999 02:57:42 +0200, "Margus Ramst"
<mar### [at] peakeduee> wrote:

>Ronald L. Parker wrote:
>
>>There is a caveat: if a child of a CSG operation already has a
>>texture, it won't be affected by any texture that's applied to the
>>CSG object as a whole.
>>
>
>Being lazy, I'll just ask without testing first...

Being lazy, I'll answer without testing first.  All textures
have all types of entries.  If you don't use a normal on a
particular texture, it inherits the one from the #default
texture.  I don't know about interiors, though, and in fact
this whole thing may have changed since I last looked at it
in version 3.0x.


Post a reply to this message

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 3 Messages Goto Initial 10 Messages

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