CS425 Laboratory 4
9/27/07 12:00 noon - 2:00 p.m.
DUE: Beginning of lab on 10/11/07
First you must demo your labs due today, then send it by email with the subject line as "Lab 3 - name".
This lab will be about lighting. This lab
lasts for two weeks.
Instructions
For a grade of Level 1
- Use your "scene" from lab 4.
- Turn on one directional light pointing parallel to
(-1, -1, -1).
- Turn on one spot light pointing at one of your objects from
a different direction than the directional light.
- Design and implement an OpenGL program to display your
lit scene.
- View the objects from a location in front and a bit to the
right of the center of the scene. Be sure all objects are
visible.
- Keep all applicable menus and key controls from previous
labs.
For a grade of Level 2
- Use your "scene" from lab 4.
- Design two lights. One is to be a directional
"morning" light pointing parallel to (-1, -0.2, -0.2). The other
light is to be positional and just above the middle of your
"scene". Switch between these two lights using a menu.
- Design two spot lights pointing at two separate objects.
Provide a switch menu for these lights.
- Design and implement an OpenGL program to display your lit
scene.
- Make a menu to select five different views. (All views
are looking toward the center of the scene.)
- From the front (positive Z axis, a bit positive X, and a bit positive Y).
- From the right (positive X axis, near zero in Z and Y).
- From the left (negative X axis, near zero in Z and Y).
- From the rear (negative Z axis, a bit negative X and a bit positive Y).
- From above (fairly large Y, near zero X and Z).
- Keep all applicable menus and key controls from previous labs.
For a grade of Level 3
- Use your "scene" from lab 4.
- Design four lights. The first is to be a directional
"morning" light pointing parallel to (-1, -0.2, -0.2). The second
is to be a directional "noon" light pointing parallel to
(0.0, -1.0, 0.2). The third is to be a directional "evening"
light pointing parallel to (1, -0.2, -0.2). The fourth is
a positional "night" light positioned directly above the scene.
Switch between these four lights using a menu. (Only one directional light
on at a time. Be able to turn off all four lights so you can
check your spots.)
- Design four spot lights pointing at four separate objects.
Provide menu switches for these spot lights.
- Design and implement an OpenGL program to display your lit
scene.
- Make a menu to select five different views. (All views
are looking toward the center of the scene.)
- From the front (positive Z axis, a bit positive X, and a bit positive Y).
- From the right (positive X axis, near zero in Z and Y).
- From the left (negative X axis, near zero in Z and Y).
- From the rear (negative Z axis, a bit negative X and a bit positive Y).
- From above (fairly large Y, near zero X and Z).
- Keep all applicable menus and key controls from previous labs.
- Make another menu to activate a "fly-around" animation of your
scene. This is simply moving the "camera" in the gluLookAt function
in a circle while keeping the view toward the center of the scene.
- Keep all applicable menus and key controls from previous labs.
For a grade of Level 4
- Use your "scene" from lab 4.
- Design four lights. The first is to be a directional
"morning" light pointing parallel to (-1, -0.2, -0.2). The second
is to be a directional "noon" light pointing parallel to
(0.0, -1.0, 0.2). The third is to be a directional "evening"
light pointing parallel to (1, -0.2, -0.2). The fourth is
a positional "night" light positioned directly above the scene.
Switch between these four lights using a menu. (Only one light
on at a time. Be sure to allow for all four directional
lights to be off so you can check your spots.)
- The fourth directional light is to be movable around the scene
in up-down, left-right, near-far directions (+-X, +-Y, +-Z).
- Design four spot lights pointing at four separate objects.
Provide menu switches for these spot lights.
- Draw a "light object" representating the location of each of the
spot lights.
- Design and implement an OpenGL program to display your lit
scene.
- Make a menu to select five different views. (All views
are looking toward the center of the scene.)
- From the front (positive Z axis, a bit positive X, and a bit positive Y).
- From the right (positive X axis, near zero in Z and Y).
- From the left (negative X axis, near zero in Z and Y).
- From the rear (negative Z axis, a bit negative X and a bit positive Y).
- From above (fairly large Y, near zero X and Z).
- Keep all applicable menus and key controls from previous labs.
- Make another menu to activate three animations of your
scene.
- A "fly_around" animation. This is simply moving the
"camera" in the gluLookAt function in a circle while keeping
the view toward the center of the scene.
- A "fly_through" animation. Start somewhere high and
in front and "swoop down and through" your scene coming back
up at the rear before stopping.
- A "walk_around" animation. This is an adjustable camera.
Using key strokes, you can:
- translate the camera forward, back, left,
and right.
- translate what the camera is looking at forward, back, left, and right.
Enrichment
Look up and use the glutMotionFunc function
to use mouse movements to move your light.
Read about shadowing and add some simple shadows
to your scene. (This is quite difficult, so only attempt it
if you have lots of time.)