PDA

View Full Version : circles in openGL c++



02-01-2004, 01:11 PM
Hello,

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 http://www.opengl.org/discussion_boards/ubb/frown.gif (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

~Sharmila~

chowe6685
02-01-2004, 02:24 PM
use sin and cos in conjunction with a line loop

Tokage
02-01-2004, 07:54 PM
That works, or if you're just concerned with tracing out a circle and not actually drawing it, glRotatef() should work.

02-02-2004, 07:15 AM
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.

02-02-2004, 06:02 PM
or use the glu comand for a disk then make the hole in the middle really big