I am trying to apply a light in my scene. However all objects are reflecting extremely and the colors get distorted.
How can I get a reflection similar to this example:
I assume I am choosing the wrong values for the materials?
This is how I setup light and materials:
void createLight() {
GLfloat mat_specular[] = {0.3, 0.3, 0.3, 1.0};
GLfloat mat_shininess[] = { 1.0 };
glMaterialfv(GL_FRONT, GL_SPECULAR, mat_specular);
glMaterialfv(GL_FRONT, GL_SHININESS, mat_shininess);
glColorMaterial(GL_FRONT_AND_BACK, GL_AMBIENT_AND_DIFFUSE);
glEnable(GL_COLOR_MATERIAL);
// Lighting set up
glLightModeli(GL_LIGHT_MODEL_LOCAL_VIEWER, GL_TRUE);
glEnable(GL_LIGHTING);
glEnable(GL_LIGHT0);
// Set lighting intensity and color
GLfloat qaAmbientLight[] = {0.2, 0.2, 0.2, 1.0};
GLfloat qaDiffuseLight[] = {0.8, 0.8, 0.8, 1.0};
GLfloat qaSpecularLight[] = {1.0, 1.0, 1.0, 1.0};
glLightfv(GL_LIGHT0, GL_DIFFUSE, qaDiffuseLight);
glLightfv(GL_LIGHT0, GL_SPECULAR, qaSpecularLight);
// Set the light position
GLfloat qaLightPosition[] = {12, 8, 12, 0.4};
glLightfv(GL_LIGHT0, GL_POSITION, qaLightPosition);
}