Computer Science 155: Graphics
Spring 1998
Homework 5
The early due date is Saturday, February 28 before midnight.
The regular due date is Sunday, March 1 before midnight.
The late due date is Monday, March 2 before midnight.
In this assignment you will implement an OpenGL robot that can be
controlled by the user. This assignment is loads of fun!
Below are the list of requirements for this assignment:
- The robot should have a body, a head, and a right arm.
(Left arm and other body parts are optional. Be creative!
A piece of chocolate for anyone implementing a robot on a unicycle!)
- The robot's position should be user controllable via
the keyboard or mouse.
- The right arm should be user controllable via the keyboard
or mouse. In particular, the user must be able to rotate
the arm (about at least one vector) at the shoulder, elbow, and wrist.
Use hierarchical coordinate systems as described in class.
- The robot's head must be user controllable via the keyboard
or mouse. The head should be able to rotate left, right, up, and down.
- You should use a lighting model with ambient, diffuse, and
specular lights and materials.
- There should be one fixed light source as well as one spotlight
mounted on top of the robot's head. The spotlight should rotate
and move with the head. The fixed light source should provide
enough light so that the entire scene is visible (even if it's dim)
without the robot's spotlight. The spotlight will be used to
provide additional illumination in the direction in which the
robot is looking.
- The robot should live in a 3D space with a shiny floor and at
least a few 3D objects in it so that the robot can be moved
around the scene and shine its spotlight on the various objects.
Make sure to partition the floor into a number of separate tiles
(as described in class) so that specular reflection from the
light sources looks reasonably good.
- Use perspective viewing.
- The 'v' key should toggle the view mode. In one mode,
the camera remains fixed and we get a view of the scene
from some fixed location.
In the second mode, the view is from the robot's
eye. Thus, in this case we see what the robot would see.
In particular, as the robot moves or rotates its head, the
view changes.
A note on implementing this: There are a number of different
things going on here and it can be confusing to do everything at
once. I highly recommend starting with just fixed color objects
(no lighting) and orthographic viewing. Once you get the geometry
of the robot working, add perspective viewing, lighting,
and camera position one at a time.
When you're done, create a directory called hw5
within your homework
submission directory. Create a file called README which contains
both compiling instructions (for example, you might have a makefile
or some other means of compiling your program) AND instructions on
how to operate the robot. Have fun with this!!!