CPSC362A
Video Game Development

Activity 11

Lights

Create an OpengGL program that allows the user to move a light.

Details

  1. The program should draw a sphere, centered in the window.

  2. The sphere should have a material with ambient, diffuse and specular reflectivity.

  3. The program should have a single spotlight behind the camera that is pointed down the negative z axis.

  4. The user should be able to change the x and y coordinates of the position of the light by moving the mouse up and down.

Example