Creating objects using basic functions

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

a cylinder and a sphere are very easy to compute
the equation of a sphere is :
x = rcosacosb
y = rsina cosb
z = r
you can discetize them into polygone very easily
for the cylinder it’s
x = r
y = r*cos(b)
z = t for 0<t<height
i did it myself and it’s increasing the speed significantly