Program 3 : The Robot With Lights

Programming Assignment

Assignment 3 will build upon the program from Assignment 2. You are to implement full Phong lighting with up to 5 light sources, using the OpenGL lighting facilities. In order to do this, you should modify the objects in your robot so that they are the same color on all faces. You may, if you like, arrange for different parts of the object to be different colors, but this is not required.

Your modified robot program should provide the user with interactive access to the full capabilities of OpenGL lighting support. This means you should be able to make each of the 5 lights you support either a directional light, a positional light, or a spotlight. Lights should be positioned interactively in much the same way that your viewing position is specified. That is, you should be able to view the scene from any of the 5 light source positions, and movements in the viewing position for the current light source should result in changes to the light direction vector. In addition, it should be possible to change all light color parameters and the spotlight parameters for any light using keyboard input (or some other method if you prefer) while you are viewing the scene from that light's position. For positional lights, it should be possible to move towards and away from the lookat point along the viewing vector interactively. This will provide the third degree of freedom needed to position the light source as a point in space. Any of the 5 lights can be any type of light, positional, direction, or spot. The type can be changed at any time by appropriate changes in light parameters. Light sources should be stationary in the world once they are positioned.

You should also provide interactive control over material properties of the robot. Diffuse, specular and ambient reflectances and emission should be modifiable under interactive control. You should also be able to change the shininess of the surface interactively. Note that these changes can apply to the whole robot, it is not necessary to have different parameters for different parts of the robot.

The Pictures

These pictures were lost in a hard-disk crash on the system my web page used to be hosted on. Sorry.