Spheres are one of the easier shapes to do because they are symetric. First you have to decide which coordinates are on the surface of your shape (in this case a sphere). For a sphere this is all points a distance r away from the centre. You need some control over reaching each coordinate so we will use two angles theta and phi. Think of the center of the sphere this is just a circle. The phi variable is the angle from the x axis. If we were just drawing a circle we would draw:
x= r cos (phi) and
y= r sin (phi)
I would imagine using a loop to increment phi and draw from one bit of phi to the next.
However we have a sphere. Now if you think of a sphere it is just lots of circles but with different radi. The radius can be worked out with a bit of trig. Draw a semicircle


 
/
Mark an angle from the verticle to a point on te semi circle. Draw a horizontal line. This line is the circle in thelast bit and has a radius of sin (theta)
This circle is at a height of r cos theta
OK so now we have all our points:
x = r sin (theta) Cos (phi)
y = rsin (theta) Sin (phi)
z = r Cos (theta)
We now make two loops and draw triangle through all these points connecting them all.
glBegin(GL_Triangle_Strip)
for (int i=0;i<maxsegs;i++){
theta=Pii/maxsegs;
thetaplus=Pi(i+1)/maxsegs;
for (int j=0;j<=maxsegs;j++){
phi=2Pij/maxsegs;
glVertex3f(rsin(theta)cos(phi),rsin(theta)Sin(phi),rcos(theta));
glVertex3f(rsin(thetaplus)cos(phi),rsin(thetaplus)Sin(phi),rcos(thetaplus));
}
}
Hope that helps,
fringe
P.S. All code writtern without testing and source so there may be mistakes but as long as you understand the idea it should be fine