POV-Ray : Newsgroups : povray.advanced-users : Simple colour_map question : Re: Simple colour_map question Server Time
29 Jul 2024 02:27:55 EDT (-0400)
  Re: Simple colour_map question  
From: Mike Williams
Date: 15 Feb 2003 11:01:04
Message: <rIOCOCA2HmT+Ewdl@econym.demon.co.uk>
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

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