View Full Version : Creating objects using basic functions

11-04-2001, 11:58 PM
How can i create shapes of cylinder and sphere using OpenGL and GLUT by only using the low level functions. I know there are functions to create cylinder and sphere but i do not wish to use them.

Thank you

11-09-2001, 01:49 AM
a cylinder and a sphere are very easy to compute
the equation of a sphere is :
x = r*cosa*cosb
y = r*sina *cosb
z = r*sinb
you can discetize them into polygone very easily
for the cylinder it's
x = r*cos(a)
y = r*cos(b)
z = t for 0<t<height
i did it myself and it's increasing the speed significantly