• Advertisement
Sign in to follow this  

drawing angles

This topic is 4230 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi all, This is probably kind of basic, but I'm trying to draw a circle w/ angle lines extending from the center point outwards and then show the degrees of each angle around the circle w/ tick marks. Anyone know a good place I can start that would have opengl example code to help me do this, and also help me in understanding drawing angles w/ degrees, theta, etc...? Any help much appreciated.

Share this post


Link to post
Share on other sites
Advertisement
The OpenGL red book has an example of drawing a circle w/ a GL_LINE_LOOP. (here is some code that will do the same). I am not familiar with any existing tools that will do this for you. It should be pretty easy to write your own classes/methods to perform the operations you want.

You know the radius of your circle. You know the center point of your circle. You can then easily draw a single line from the center point to a point on the actual circle (center point + radius = distance). Then you need the second line (to give you a particular sector of the circle). You can use basic circle formulas and trig to march around the circumference of the circle to a 2nd point. Then draw a line from the center to this 2nd point. This gives you a sector of a circle. Circle arc and segment formulas will probably be helpful.

Hope that helps.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement