I’m having trouble when I turn my light on. I have a scene with a green polygon for the ground, a quadric cube, a quadric sphere, and a sky dome. When I turn my light on the sky looks fine but the rest of the scene is a pale green. My cube is supposed to be red, the ground green, and the sphere yellow but they all appear this lime green color. Anybody have any ideas that can help me get my colors back? Here is my light code:
/* Lighting variables */
// float ambientLight[] = {0.3f, 0.5f, 0.8f, 1.0f};
float ambientLight[] = {0.3f, 0.9f, 0.5f, 1.0f};
float diffuseLight[] = {0.25f, 0.25f, 0.25f, 1.0f};
float lightPosition[] = {0.0f, 0.0f, 10.0f, 0.0f}; //Light comes from Z = 10.0
float light2Position[] = {0.0f, 0.0f, 10.0f, 1.0f}; //Light is located at Z = 10.0
/* Lighting materials */
float matAmbient[] = {1.0f, 1.0f, 1.0f, 1.0f};
float matDiff[] = {1.0f, 1.0f, 1.0f, 1.0f};
/* Enable lighting */
glEnable(GL_LIGHTING);
/* Set up the materials for LIGHT0 */
glMaterialfv(GL_FRONT, GL_AMBIENT, matAmbient);
glMaterialfv(GL_FRONT, GL_DIFFUSE, matDiff);
/* Set up LIGHT0 */
glLightfv(GL_LIGHT0, GL_AMBIENT, ambientLight);
glLightfv(GL_LIGHT0, GL_DIFFUSE, diffuseLight);
glLightfv(GL_LIGHT0, GL_POSITION, lightPosition);
/* Enable the light */
glEnable(GL_LIGHT0);