|
![](/i/fill.gif) |
In article <403### [at] hotmail com>,
andrel <a_l### [at] hotmail com> wrote:
> Just kidding, I understand what you mean. My first reaction would be
> that pigments can be much more complicated than just a simple color.
> That is what POV makes exciting. I do not immediately see how you can
> handle that complexity in a understandable way. I will think about that
> (later).
This is not a problem. All pigments are pigments, but you can have solid
pigments, patterned pigments with color maps, patterned pigments of
pigments, etc...object orientation simply provides a clean way of
classifying and managing the types of things.
red_sphere.pigment = solid_pigment {color rgb < 1, 0, 0>}
And now make it dark red:
red_sphere.pigment.color = color < 0.5, 0, 0>;
Or make it darker, no matter what color it currently is:
red_sphere.pigment.color *= 0.5;
Of course, trying to get the color of a patterned pigment is ridiculous,
and would produce an error...POV would tell you that the pigment doesn't
have a color. And if you want to get the color of a pigment at a certain
point, you would do it the same way, without having to think about what
kind of pigment it is. To use an example in current POV:
#declare MyObj = object {MyObj translate y*2}
This translates MyObj by y*2, no matter what MyObj is. It doesn't matter
if it's a sphere or box. Now that's a bit awkward, an OO version would
be more like:
MyObj translate: y*2;
or (Java/C++ style):
MyObj.translate(y*2);
Is that harder to understand? It simply translates MyObj, rather than
redeclaring MyObj as a translated version of itself.
--
Christopher James Huff <cja### [at] earthlink net>
http://home.earthlink.net/~cjameshuff/
POV-Ray TAG: <chr### [at] tag povray org>
http://tag.povray.org/
Post a reply to this message
|
![](/i/fill.gif) |