|
|
"sam kim" <nomail@nomail> wrote in message
news:web.498e2c69a703dd17c859cee0@news.povray.org...
> Thank You for your prompt reply.
>
> It was a lot to swallow, I found something peculiar about using object
> as pigment while trying to figure out what you did.
> The default color values for the very last object-pigment is green,
> the rest of them being blue (unless transmit is used, then it's green).
I don't think that's correct.
The first color specified is for anything outside the object, the second is
for inside. The default for outside is blue and the default for inside
green. If you only specify one color it's taken as the color for anything
outside the object.
> pigment-object is an interesting type of csg it seems, where
> the intersection of p-o and the object is kept (also the object is there)
> while complement of the object does not show up.
It is something interesting and it's not something that's used very much.
It's not a type of CSG though. Any object that has a well-defined inside and
an outside (spheres, cylinders, planes etc.) can be used to define a pigment
in this way. Objects are conventionally used as objects and have
pigments/textures applied to them. The ability to use an object to create a
pigment in this way is however something that occasionally turns out to be
convenient.
The object isn't actually 'there' though. It is used to define a 3
dimensional pigment. In this case the CSG objects themselves are never
displayed in the scene, they are only used to create the pigment components
of the layered texture that is displayed on the surface of the mesh2 object.
> It seems that two colors are needed for pigment-objects
> first one for an in-between layer and the second for the pigment-object.
> If only one color is given for a pigment-object, then the in-between layer
> (everything else) takes on that color, and the pigment-object gets green.
> If only one color is given for a pigment-object, then the in-between layer
> (everything else) takes on blue, and the pigment-object gets green.
It's really just that everything outside the 3D object is given the first
color and that everything inside is given the second color.
The mesh2 object can be imagined as slicing through the 3D space containing
the 3D texture. To determine which part of the layered texture to use it
evaluates the top layer first and finds a slice of a torus, stretched in Z
to form a hollow cylinder which it colors green. Because everything outside
that is transparent it looks at the next layer on the texture etc. etc.
An alternative way to define this hollow cylinder shape would be to use the
difference between two cylinders, one longer and thinner than the other. You
could then avoid having to scale each CSG. Also, unlike the torus, cylinders
can be defined in position, so you could do away with the need to rotate and
translate the torus.
> I am a soph. comp-sci major, so loop wasn't much of an issue.
Ah ok. Good :o)
Well you can probably see that the mesh2 definition can be tidied up by
using variable definitions in place of literals. You can also use an
elaborate collection of functions within the specification of the 3D
coordinates in the first nested loop to distort the mesh in far more
interesting and potentially flag-like ways.
Regards,
Chris B.
Post a reply to this message
|
|