normals for sphere


I am making a solar system scene. I am using glutSolidSphere() to make the sun and the planets. I currently have ambient light for the scene and some sun emissive light.

I would like for the side of each planet that is facing the sun to be lighted. I assume this is done using diffuse light. I think I have the initial setup right (except normals-declaration), but am not seeing the light effects.

I did the following:
-positioned a light (GL_LIGHT0) at the location of the sun
-enabled LIGHT0
-and I enabled the diffuse property of the planet material (GL_AMBIENT_AND_DIFFUSE)

I know that I need normals for the surface so the diffuse intensity can be derived. So my question is this: does OpenGL ‘know’ the normals when using glutSolidSphere()? If not, is there an easy way to make some for a sphere?

Any help is much appreciated!

create an sphere made of lots of triagles
you´ll have total control over the vertex normals

or you can simply define a normal for your glut sphere using glNormalXX


as I know(maybe from redbook) You don’t have to deal with normal if You use glutSolidSphere() for sphere drawing, because glut*() functions make the polygon mesh and normals too.


Thanks . . . I think I’ve got it, now.