circles in openGL c++


I’m working on an openGL program for a beginner level graphics course that I’m taking in university. And our program is to create a robot that swings it’s arms in 360 degrees…and the structure should be built using a kinetic tree (haven’t gotten there yet)

But what my question is…how do i draw a cirle in openGL?

if anyone can help me with this it will be greately appreciated. thanks in advance


use sin and cos in conjunction with a line loop

That works, or if you’re just concerned with tracing out a circle and not actually drawing it, glRotatef() should work.

Or you could load a circle graphic and texture it onto a quad.

I’m guessing you’re after a 2D, side-projection, wireframe model of a robot with, say, a two jointed arm? In which case you’ll want to use the line loop to draw the arms and joints, calling glRotatef to angle the arm at each joint.

or use the glu comand for a disk then make the hole in the middle really big