PDA

View Full Version : howto generate colors



muhkuh
08-21-2002, 02:15 AM
Is there a way to let OpenGl gegerate colors similar to the texture coordinate generation ? I want to render a 3d graph where the higher a Vertex is the more should it turn from green to red.
My only idea would be to use a 3d texture with 2 planes, a red and a green one. This way I could use texgen functionality but this seems to be overkill.

muhkuh
08-21-2002, 02:18 AM
Well, after thinking about it again the best solution seems to be a 1D texture but is there any way to let opengl generate color values at all ?

Bob
08-21-2002, 02:36 AM
Lighting will generate colors for you.

fringe
08-21-2002, 03:39 AM
You can also switch off lighting and just use colour3f to colour vertexs and smooth colours enabled to shade from red to blue. See HeNe tutorials for his pyramid (this has a different colour for each corner).