PDA

View Full Version : drawing a circle



fox
12-11-2000, 01:37 AM
is there an opengl function for drawing a circle?

Bob
12-11-2000, 02:40 AM
Nope. Use a for-loop and some trigonometry and draw them yourself instead.

fox
12-11-2000, 02:44 AM
any code?

FooLman
12-11-2000, 06:49 AM
How about this:

void circle(float radius)
{
int x;
glBegin(GL_LINE_LOOP);
for (x=0;x<360;x+=5)
{
glVertex3f(cos(x*PI/180)*radius,sin(x*PI/180)*radius,0.0);
}
glEnd();
}

FooLman

fox
12-12-2000, 03:47 AM
cheers!

CanEHdien
09-08-2001, 06:05 PM
finally some circle code that works - thanks man.