POV-Ray : Newsgroups : povray.newusers : color_map : Re: color_map Server Time
2 Jun 2024 11:38:47 EDT (-0400)
  Re: color_map  
From: Warp
Date: 17 Aug 2012 11:04:19
Message: <502e5d72@news.povray.org>
ltong <nomail@nomail> wrote:
> This is certainly simple for advanced users, but I'm having problem to figure it
> out. The documentation says value_n in color_map is calculated using x,y,z
> location of a point where color_n will be applied. So, how is value_n calculated
> exactly? How does one know which position value_n represents in an object? I
> would guess translation and rotation don't affect. Many thanks in advance!

One important thing to understand is that color maps (or pigments in
general) are actually not dependent on any object (with the exception of
the aoi and slope patterns, which are probably the only ones that do depend
on an object).

A pigment and everything that it contains is basically a three-dimensional
function that fills the entire universe. In principle you could render a
pigment as the coloring of the entire three-dimensional universe, without
any object. (In fact, if you had voxel rendering capabilities, you could do
exactly this.)

What happens when you apply it to an object is that the surface of the
object gets colored by this universe-filling pigment at the places where
this surface is located. (It's a bit like the object's surface "intersects"
with the pigment, and you see the color of the pigment at those places.)

These universe-filling pigments are defined in terms of a three-dimensional
function. This is a function that assigns a value between 0.0 and 1.0 to
each point in space. (In other words, take any point in the universe, and
this function gives you a value between 0.0 and 1.0 for that point.)

POV-Ray offers many ready-made functions for this, called patterns. (You
can also create your own by writing a user-defined function and using it
as a pattern.)

Maps can be used to assign pigment-defining characteristics (such as colors)
to those values. For example with a color map you can tell that all points
in space with the value 0.0 are red, all points with the value 0.7 are blue,
and all points with the value 1.0 are black. (The colors for all the other
values are interpolated between those, as to give a smooth transition.)

In other words, take any point in space, and now the pigment tells you what
color it has.

When you apply this pigment to an object, it will color the surface of the
object as I described above. (Basically what happens that for each point on
the surface of the object the pigment tells what color is there.)

There's a way to concretely visualize how the object "intersects" with
the pigment: Translate the object in an animation, but do not translate
the pigment with it. (There are several ways how this can be achieved,
one of which is to simple apply the reverse translation to the pigment
as you are applying to the object.) You can see visually how the object's
surface "cuts" the three-dimensional pigment as it moves through space.
(This demonstrates quite well how the pigment is independent of the object.)

-- 
                                                          - Warp


Post a reply to this message

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