• GLfloat lightA_position[ ] = {1.0, 1.0, 1.0, 0.0};
• GLfloat lightB_position[ ] = {1.0, 2.0, 3.0, 1.0};
• glLightfv(GL_LIGHT0, GL_POSITION, lightA_position);
•
glLightfv(GL_LIGHT1,
GL_POSITION, lightB_position);
• The
above defines a directional light source coming from the direction (1, 1, 1), and a positional
light source located at the point
(1, 2, 3) in the world coordinates.