PDA

View Full Version : How do you make a Circle?



CanEHdien
09-08-2001, 02:55 PM
AHHHHHH! lil help pls http://www.opengl.org/discussion_boards/ubb/smile.gif

Dodger
09-08-2001, 07:33 PM
float scale = 1.0;
int step = 5;

glBegin(GL_TRIANGLE_FAN);

for(float ang=0; ang<360; ang+=step){
x = cosf(ang*3.14f/180.0f) * scale;
y = sinf(ang*3.14f/180.0f) * scale;
glVertex3f(x, y, 0.0);
}

glEnd();

adjust the values for scale and step to your needs http://www.opengl.org/discussion_boards/ubb/wink.gif

CanEHdien
09-08-2001, 07:36 PM
thank you so much http://www.opengl.org/discussion_boards/ubb/smile.gif