Please note that MANY of these "comments" below were provided by students and have not been confirmed.
Sure, the more the merrier. :-)
Make sure you initialize everything! This will especially help if you want your code to run on multiple platforms! For example, the default value for ambient lighting seems to be different on different machines.
Make sure you clear the depth buffer each time before drawing your scene.
The Modelview matrix is applied first and then the Projection matrix.
They allow you to save the state of a matrix. For example, suppose that you want to position 3 spheres into a single scene at different locations using a particular camera/eye coordinate system. It would make sense to use the ModelView matrix by loading the identity and then the glLookAt matrices. Then to position the spheres, you would need to apply a different translation matrix before drawing each sphere. Now you could reload the identity and LookAt matrices before each translation is applied and sphere is drawn, but you could also push the Modelview matrix BEFORE applying the first translation to the first sphere. Then, when you pop the matrix off the stack, you'll be back to a matrix that just has the LookAt matrix in it.
The default values for every light other than LIGHT0 are set as BLACK. (If you think about this, it kind of makes sense.) So, if you haven't set the light properties for GL_AMBIENT or GL_DIFFUSE, your light won't show up!
Absolutely.
OpenGL doesn't do shadows automatically; Your textbook discusses HOW to make shadows.
Did you specify material properties for those objects? If you don't specify material properties for a surface and then you turn off the lights, the surface doesn't respond to lights.
You might start with the Figure 8.17 in your textbook on page 423 or take a look at the examples in the http://www.cs.rit.edu/usr/local/pub/ncs/graphics/OpenGL/ExamplesLab4/Materials/ directory, especially teapots.
Did you specify material properties for those objects? If you don't specify material properties for a surface and then you turn off the lights, the surface doesn't respond to lights as well.
Yes, I have put three examples in the Materials section of the ExamplesLab4 directory. The first materialOnOff.c simply sets the materials back to their default values which are AMBIENT ( .2, .2, .2, 1.0 ), DIFFUSE ( .8, .8, .8, 1.0 ), SPECULAR ( 0, 0, 0, 1 ), EMISSION ( 0, 0, 0, 1 ), and SHININESS ( 0 ). The second, materialOnOff1.c does the same thing by using glPushAttrib and glPopAttrib. The third materialOnOff2.c uses glEnable( GL_COLOR_MATERIAL ) and glDisable( GL_COLOR_MATERIAL )
Each example turning a material on and off in response to the default white light, LIGHT0, using the letter 'o' as the on/off switch.
Use texture mode GL_MODULATE rather than GL_DECAL in the glTexEnv function or see SIGGRAPH tutorial on texture. Otherwise material properties have no effect.
There are many reasons this could happen:
Use glEnable( GL_TEXTURE_2D ) before and glDisable( GL_TEXTURE_2D ) after each object you want to texture. In between you'll need to specify the name of the texture you want to be applied to this object. (These names will probably have been set up in your initialization function, see texbind.c for an example of how to do this.)
I have no idea, but things to look for usually tend to be initialization stuff.
You should only need to bind textures if you are using more than one to prevent having to reload textures into texture memory each time you need them.
I read in Angel's book that "If glBindTexture() is called with "name" set to 0, the normal texture calls apply, and the present texture that is part of the OpenGL state and the present values of the texture parameters apply." I read this to mean that if you set up some texture parameters, then bound others to another name, say 1, that if you bind to 0 before drawing an object you will get the original setup. So, if you only started off binding to 0 and then specifying texture parameters, there will have been none set.
Use texture mode GL_MODULATE rather than GL_DECAL in the glTexEnv function or see SIGGRAPH tutorial on texture. Otherwise material properties have no effect.
See /usr/local/pub/ncs/graphics/OpenGL/ExamplesLab4/TextureReading/ or http://www.cs.rit.edu/usr/local/pub/ncs/graphics/OpenGL/ExamplesLab4/ for examples of code to read raw, targa, and bitmaped files. A ppm reader is used in http://www.cs.rit.edu/usr/local/pub/ncs/graphics/OpenGL/ExamplesLab4/Texture/. In particular, maiden uses .ppm files - also available in that directory. The SIGGRAPH tutorial code shows how to use .sgi file and provides some.
As far as creating your own, someone has reported that GIMP, a free photoshop clone, can take any image and save it as a .c file. It essentially creates a structure with fields describing an image and a datafield with RGB data.
No, you do NOT have to use it. I've put some more texture examples out in the directory http://www.cs.rit.edu/usr/local/pub/ncs/graphics/OpenGL/ExamplesLab4/Texture/ with names beginning with glutTexturedSphere and gluTexturedSphere and applying the checkerboard texture or at least trying to. These use commands that cause the texture coordinates to be generated automatically. Check them out in the openGL reference manual.
See the SIGGRAPH tutorial on fog and the example in the http://www.cs.rit.edu/usr/local/pub/ncs/graphics/OpenGL/ExamplesLab4/Fog/ directory.
Also, remember that fog is applied to a depth, i.e., using near and far values.
Often fog looks best when its the same color as the background. If it's a night scene, you may want to lighten it some.
It may just depend on the machine's setting, but do make sure you have everything initialized properly.
You can only control how deep into your image the fog is, i.e., near and far Z values. You might try a different camera angle to gain more control of what is seen.