Dear all,
Hi, i’m trying to draw a circle and sphere with OpenGL. But i don’t know how. Could anyone drop me some hints plase~ thanks.

I looked at some of the sites that talke about opengl, but most of them only talk about cubes and triangles, but not spheres… (~_~) Even the book that i have, they use GLUT instead…

If any of you can drop me some hits, that would be great, once again, Thanks~~

(by the way, i need it in a kinda of hurry, for a project, thanks~~~ )

Under the glu library (glu.h):
gluSphere, gluDisk (Circle)

Under the glut library (glut.h):
glutSolidSphere, glutWireSphere.

Another option for drawing a circle is the use the math function for a circle using sin/cos.

Originally posted by [aNewbie]:
[b]Dear all,
Hi, i’m trying to draw a circle and sphere with OpenGL. But i don’t know how. Could anyone drop me some hints plase~ thanks.

I looked at some of the sites that talke about opengl, but most of them only talk about cubes and triangles, but not spheres… (~_~) Even the book that i have, they use GLUT instead…

If any of you can drop me some hits, that would be great, once again, Thanks~~

(by the way, i need it in a kinda of hurry, for a project, thanks~~~ )[/b]

(do they do support for cube too? or this one have to go to GLUT? coz the code isn’t for me, is for my friend. If i can do it with cubes…etc too, then the code wouldn’t look so mess, he would be easier to follow…
)

Once agin, Thanks~~~~

Originally posted by nexusone:
[b]There are two sphere rutines that you can call.

Under the glu library (glu.h):
gluSphere, gluDisk (Circle)

Under the glut library (glut.h):
glutSolidSphere, glutWireSphere.

Another option for drawing a circle is the use the math function for a circle using sin/cos.

First you should get your friend on this web site to help him learn.

glut is good for simple quick objects, but has some limitation.

some of the other shapes: Cube, Cone, Torus, Dodecahedron, Teapot.
glutSolid"shape" or glutWire"shape"

Originally posted by [aNewbie]:
[b]Thanks~~ (^_^)

This save me big time~~ Thanks (^_^)

(do they do support for cube too? or this one have to go to GLUT? coz the code isn’t for me, is for my friend. If i can do it with cubes…etc too, then the code wouldn’t look so mess, he would be easier to follow…
)

Fair enough possibly with the sphere, But surely you can see that a cube can easily be constructed from squares, and each square can be made of 2 triangles…