|
![](/i/fill.gif) |
If you're able to control the format of that file it would be easier to have
the syntax:
<x,y,z>,E
and read MyVect directly:
#while (defined(MyFile))
#read (MyFile, MyVect)
sphere {MyVect, 1 texture {pigment {color rgb <a,b,c>}}}
#end
#fclose MyFile
To answer your question, it is possible.
The easiest approach i'm aware of is declaring the color in HSL color space
(hue, saturation, lighness) and convert it to RGB color (red, green, blue)
with the function CHSL2RGB(Color) in "colors.inc"
(see documentation for details
http://www.povray.org/documentation/view/3.6.1/434/)
then something like
pigment { color rgb CHSL2RGB<E,240,120> }
where E is in the range 160 (blue) to 0 (red) should do.
It's possible that i'm confusing the range of the HSL values. i think its
<0,0,0> to <240,240,240> but i'm not sure. you might need some testing or
an advice of another person...
Hope that helps
Regards Roman
Post a reply to this message
|
![](/i/fill.gif) |