PDA

View Full Version : How to draw Pie Chart



efang
11-05-2004, 05:34 AM
Hello,
Can anyone tell me how can i draw the pie chart by using the visual C++??

Thank you.

ZbuffeR
11-05-2004, 09:38 AM
You mean, with OpenGL ? :)

Draw a triangle fan for each color :
- first vertex at the center of the pie
- all subsequent vertices will be at the edge, approximating a circle.

See this sample picture (http://www.opengl.org/resources/tutorials/sig99/advanced99/notes/node18.html#fig:tri5) .