How to Draw a Circle without using GLUT

hello everyone

i am a beginner and want to know how to draw a circle in openGl without using glut.i am making my application in Visual C++ Win32 API. your help will be greatful
thanks
kashif

x = xpos + radius * cos( v);
y = ypos + radius * sin( v);

v = 0 to PI*2 = full circle

Mikael

thanks for the maths but what i want to knoe the OpenGL API from which i can draw the circle . like we have
glLine, glPoint, gluSphere etc. any thing like that . i have to use glPoint with teh math u mentioned or what other thing .
thanks

No, you can use GL_LINE_STRIP to create the circle, you don’t have to use GL_POINTS, the OpenGL api does not have any way to create a circle for you.

Mikael

You could use gluDisk, I don’t think glut has a circle command anyway.

gluDisk has a outer radius and inner radius settings, just make the inner close to the outer to make a circle.

Originally posted by kashif saeed:
thanks for the maths but what i want to knoe the OpenGL API from which i can draw the circle . like we have
glLine, glPoint, gluSphere etc. any thing like that . i have to use glPoint with teh math u mentioned or what other thing .
thanks

If you want a filled circle, you could also use a GL_TRIANGLE_FAN, where the first point is the center, and the rest of them are on the perimeter, calculated using the function already given.