Calcuation of normals

Thanks chowe6685
your suggestion worked.
Can you explain me what it exactly meant.
And why it worked

Thanks
aus

glad you finally solved the problem.
when using lighting gl combines the light color and the material color. glMaterial sets the material properties, GL_FRONT_AND_BACK specifies which faces to apply the settings to

GL_AMBIENT_AND_DIFFUSE specifies which propery of the material we are changing

the last value is what color you are changing to
someone might have a better explanation than me, or you could check the red book, but in general whenever you use lighting you need either glMaterial or GL_COLOR_MATERIAL, the latter is easier, but didn’t work in your situation and glMaterial is a more flexible command

hope that helps