POV-Ray : Newsgroups : povray.general : Question for the Gurus Server Time
12 Aug 2024 19:37:28 EDT (-0400)
  Question for the Gurus (Message 1 to 10 of 13)  
Goto Latest 10 Messages Next 3 Messages >>>
From: Ken
Subject: Question for the Gurus
Date: 30 Jan 1999 10:14:51
Message: <36B321CE.67FED493@pacbell.net>
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: Spider
Subject: Re: Question for the Gurus
Date: 30 Jan 1999 10:33:23
Message: <36B32520.71C2C961@bahnhof.se>
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: Ken
Subject: Re: Question for the Gurus
Date: 30 Jan 1999 12:07:59
Message: <36B33C53.9474F0C0@pacbell.net>
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

  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.
  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.
 If I have a red sphere and intersect it with a blue plane
I will have a half round red sphere with a blue flat face.
When I intersect a sphere with a given pigment or interior
type with a plane that has identical properties I would expect
no change in the objects properties since they are equal.
Nor would I expect a difference in appearance from just
treating the two intersected objects as a whole with a single
pigment and material type.

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 ?

I am so confused.

-- 
Ken Tyler

tyl### [at] pacbellnet


Post a reply to this message

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

Goto Latest 10 Messages Next 3 Messages >>>

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