GLfloat Red[] = {1.0, 0.0, 0.0, 1.0}; glMaterialfv(GL_FRONT_AND_BACK, GL_AMBIENT, White); glMaterialfv(GL_FRONT_AND_BACK, GL_DIFFUSE, White); glMaterialfv(GL_FRONT_AND_BACK, GL_SPECULAR, White); glMaterialf(GL_FRONT_AND_BACK, GL_SHININESS, 20); glSolidTeapot(4)
void Lights() { GLfloat lightDiffuse[] = {1.0, 1,0, 1.0, 1.0}; GLfloat lightSpecular[] = {1.0, 1,0, 1.0, 1.0}; GLfloat lightAmbient[] = {0.2, 0,2, 0.2, 1.0}; glEnable(GL_LIGHTING); glEnable(GL_LIGHT0); glLightfv(GL_LIGHT0, GL_AMBIENT, lightAmbient); glLightfv(GL_LIGHT0, GL_SPECULAR, lightSpecular); glLightfv(GL_LIGHT0, GL_DIFFUSE, lightDiffuse); return; }
GLfloat lightPosition[] = {0,4,0,1.0}; glLightfv(GL_LIGHT0, GL_POSITION, lightPosition);