home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Inside Multimedia 1995 December
/
IMM1295.ISO
/
share
/
grafik
/
povhelp
/
colormap.hlp
< prev
next >
Wrap
Text File
|
1994-07-05
|
2KB
|
57 lines
The gray scale default colors of the gradient pattern isn't a very inter-
esting sight. The real power comes from specifying a color map to define
how the colors should blend.
Each of the various pattern types available is in fact a mathematical
function that takes any x,y,z location and turns it into a number between
0.0 and 1.0. That number is used to specify what mix of colors to use from
the color map. A color map is specified by:
color_map {
[NUM_1 color C1]
[NUM_2 color C2]
...
}
where NUM_1, NUM_2... are float values between 0.0 and 1.0 inclusive. C1,
C2 ... are color specifications.
NOTE: The [] brackets are part of the actual statement. They are not
notational symbols denoting optional parts. The brackets surround each
entry in the color map. There may be from 2 to 20 entries in the map. For
example:
sphere {
<0,1,2>, 2
pigment {
gradient x
color_map {
[0.1 color Red]
[0.3 color Yellow]
[0.6 color Blue]
[0.6 color Green]
[0.8 color Cyan]
}
}
}
The pattern function is evaluated and the result is a value from 0.0 to
1.0. If the value is less than the first entry (in this case 0.1) then the
first color (Red) is used. Values from 0.1 to 0.3 use a blend of red and
yellow using linear interpolation of the two colors. Similarly values from
0.3 to 0.6 blend from yellow to blue.
NOTE: The 3rd and 4th entries both have values of 0.6. This causes an
immediate abrupt shift of color from blue to green. Specifically a value
that is less than 0.6 will be blue but exactly equal to 0.6 will be green.
Moving along, values from 0.6 to 0.8 will be a blend of green and cyan.
Finally any value greater than or equal to 0.8 will be cyan.
If you want areas of unchanging color you simply specify the same color
for two adjacent entries. For example:
color_map {
[0.1 color Red]
[0.3 color Yellow]
[0.6 color Yellow]
[0.8 color Green]
}
In this case any value from 0.3 to 0.6 will be pure yellow.