|
Specifying the position
and color of a light
GLfloat light_ambient[] = { 0.0, 0.0, 0.0, 1.0
};
GLfloat light_diffuse[] = { 1.0, 1.0, 1.0, 1.0
};
GLfloat light_specular[] = { 1.0, 1.0, 1.0, 1.0
};
GLfloat light_position[] = { 1.0, 1.0, 1.0, 0.0
};
glLightfv(GL_LIGHT0, GL_AMBIENT, light_ambient);
glLightfv(GL_LIGHT0, GL_DIFFUSE, light_diffuse);
glLightfv(GL_LIGHT0, GL_SPECULAR, light_specular);
glLightfv(GL_LIGHT0, GL_POSITION, light_position);
Note: Remember to turn on each light
with glEnable(). (See "Enabling Lighting" for more information about how
to do this.)
|
|