drawing a circle

I am trying to draw a circle by using glutWireSphere but it didn’t work. I even using example about planet.c (example 3.6) but nothing come up.
Any suggestion??? Thanks

If you want to use a glut Sphere then you can scale one of the axis down so that the sphere gets squashed.

However if you want to really want to draw a circle then use a triangle fan. Computing the coordinates is simple

for instance
x = cos(alpha)
y = sin(alpha)
z = 0

where you vary alpha by 5 degrees or so depending upon your demand on how curve the circle should be.

Antonio www.fatech.com/tech

If you were using glutWireSphere, I’m guessing you want a circle outline rather than a filled circle. In which case you’d probably be better off with GL_LINE_LOOP than GL_TRIANGLE_FAN.

Ooh, everything’s gone pastel…