|
![](/i/fill.gif) |
Wasn't it Andrew Coppin who wrote:
>Suppose I declare a colour_map. Is there a way to read a colour out of the
>map? In other words, is there a way I can feed in a nindex value and find
>the corresponding colour?
>
>The docs say I can fetch the colour of a point out of a texture, but what
>I'm asking for is one step simpler than that... Any ideas folks?
Well, you could go one step more complicated than that, and declare an
object that has a pigment something like
pigment { function{ nindex } colour_map {[...
(where nindex is a declared constant) and then fetch the colour off any
point on that object.
If you want to be able to process many nindex values from the same
colour map in one scene, then you could declare an object that has a
pigment like
pigment { function{ x } colour_map {[...
then fetch the colours off that object at points where the x co-ordinate
is equal to the nindex values you are interested in.
--
Mike Williams
Gentleman of Leisure
Post a reply to this message
|
![](/i/fill.gif) |