GLfloat materialAmbient[] = {0.2, 0.2, 0.2, 1.0};
GLfloat materialDiffuse[] = {1.0, 0.8, 0.0, 1.0};
GLfloat materialSpecular[] = {1.0, 1.0, 1.0, 1.0};
+GLfloat materialShine = 100.0;
/* Light parameters */
-GLfloat lightShine = 100.0;
GLfloat lightGlobalModel[] = {0.2,0.2,0.2,1};
GLfloat lightGlobalEmission[] = {0.0, 0.3, 0.3, 1.0};
GLfloat lightBallSize = 0.2;
extern GLfloat materialAmbient[];
extern GLfloat materialDiffuse[];
extern GLfloat materialSpecular[];
+extern GLfloat materialShine;
/* Light parameters */
extern GLfloat lightShine;
}
void initializeLights() {
+ glMaterialfv( GL_FRONT_AND_BACK, GL_AMBIENT, materialAmbient );
+ glMaterialfv( GL_FRONT_AND_BACK, GL_DIFFUSE, materialDiffuse );
+ glMaterialfv( GL_FRONT_AND_BACK, GL_SPECULAR, materialSpecular );
+ glMaterialf ( GL_FRONT_AND_BACK, GL_SHININESS, materialShine );
+
glLightModelfv(GL_LIGHT_MODEL_AMBIENT, lightGlobalModel);
glLightModeli(GL_LIGHT_MODEL_COLOR_CONTROL, GL_SEPARATE_SPECULAR_COLOR);