PDA

View Full Version : circular color gradient?



wwuster
05-14-2010, 08:16 AM
I need to draw a circle where the perimeter is one color and the center is another color, and with a gradual transition from the perimeter to the center.

Is it possible to draw that with opengl?

William

strattonbrazil
05-14-2010, 08:34 AM
Sure. Just use a triangle fan to make the circle with all the vertex colors on the outside being the outside color and the interior vertex being the inside color. If you have smooth shading turned on, it will give you a nice gradient between the vertices.