Skip to main content
gamedev.net
🔒 Locked

circle

Started by mike74 Sep 20, 2005 at 3:27 AM 2 replies 1.2k views
Original Post
mike74
mike74
Is there any easy way to draw a circle in OpenGL? I already tried: glPointSize(25.0); glEnable(GL_POINT_SMOOTH); glBegin(GL_POINTS); glVertex2f(0, 0); glEnd(); But, it seems my graphics card limits the radius to about 5 pixels. mike http://www.coolgroups.com/
Mike C.http://www.coolgroups.com/zoomer/http://www.coolgroups.com/ez/
Fruny
Fruny
The easiest way to draw a circle is as a regular convex polygon with a large number of sides. Barring that, you can resort to using quadrics (e.g. gluDisk), which pretty much amounts to the same.
"Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it." — Brian W. Kernighan
initial_reality
initial_reality
I think what zedzeek meant is:

glBegin(GL_POLYGON);
for (a=0; a<2*M_PI; a+=2*M_PI/numOfEdges)
glVertex2f(cos(a), sin(a));
glEnd();

moreover, you can compile it (check for glCompile, I think)

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.