views:

405

answers:

3

I would like to draw a chart in OpenGL similar to the donut graph at the bottom-right of this example.

I have experience with drawing 2D charts such as the main chart in the example but what confuses me about the one I want to draw is the correct type of primitive to use when drawing the 3D chart. I have considered using GL_QUAD_STRIP and GL_POLYGON but neither seem quite right for the task. Where should I begin?

I will be using JOGL with Java to draw the chart, if that helps at all. Also, I don't necessarily need to extrude certain slices of the chart as shown in the example.

Update: I do need to use OpenGL for drawing even if there are easier alteratives. This is part of my research for an assignment that requires OpenGL rendering.

Infographics Example

+1  A: 

Are there any specific reasons why you want to use OpenGL to draw these charts?

I've been hearing pretty good things about JFreechart.

wvd
This is part of my research for an assignment and so I have to use OpenGL for drawing. Otherwise, yes, there are probably many easier ways to draw charts!
paulbeesley
+2  A: 

Just use GL_TRIANGLE_STRIP, there will be four strips per segment of the donut (or torus): top, bottom, outer and inner. If you decide to support extrusion, you will of course need "endcaps" for each segment, too.

You can probably find tutorials by searching for torus rendering.

unwind
A: 

I'm a bit of a newbie with this type of technology - am looking for an easy way to draw a donut chart on demand with data a user will enter on a web page... any suggestions as to what solution would be good to use? (I currently have the application generating the chart in Excel 2003 and not sure if there's an easy way of getting that onto a web page)

Any suggestions would be helpful.. thanks!

Life Coach