PDA

View Full Version : fading colour



fox
01-15-2001, 02:04 AM
I want to set the colour of a cone so that it fades - it is strongest at the point and then fades towards the base

I'm using glMaterialfv(......) to set the colour

cheers

Nigel
01-15-2001, 04:48 AM
Originally posted by fox:
I want to set the colour of a cone so that it fades - it is strongest at the point and then fades towards the base

I'm using glMaterialfv(......) to set the colour

cheers

The easiest way to do it, I think, is making the cone with a GL_TRIANGLE_FAN, and enable smooth shading, glShadeModel(GL_SMOOTH). Now you can specify a new color for each vertex, and the colors of the triangles will smoothly go from black to white or whatever color you want.

good luck!
Nigel