CS425 Laboratory 3
9/20/07 12:00 noon - 2:00 p.m.
DUE: BONL
NOTE: During lab you will need to demo your program for me, and then send me the code by email.
Be sure to email a copy of your code before 2:00 on
9/20/2007, email it to my account, even if it isn't quite working yet.
Exit Criteria:
You have created your "scene" to be used from now
on. You can easily position your objects in the
world and easily view your scene from various
locations.
Special Note!
This lab will be about building a
"scene", viewing and simple animation.
From this point onward, you will
almost always be working with the same "scene."
You can use a large number of "faces" per object,
but this will make your display go slower.
Be sure to have some non-symmetrical objects
to make the scene more interesting.
Theme for Fall 2007 is Robotics
Instructions
For a grade of Level 1
- Instantiate 9 objects.
Make the objects "fit" into some kind of
scene using the ROBOTICS theme.
- Use one vertex array per unique fundamental object.
- Design a single function for each unique object. This function
will call on other functions to do scaling, rotation, and translation
within the object in addition to matrix manipulation. Hint: Be sure
to leave the matrix as you found it each time to avoid cascading
effects.
- You must use transformation calls to position the instantiations
in your scene.
- Design and implement an OpenGL program to display these
objects as wire frames.
- 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.
For a grade of Level 2
- Instantiate 15 objects.
Make the objects "fit" into some kind of
scene using the ROBOTICS theme. .
- Use one vertex array per unique fundamental object.
- Design a single function for each unique object. This function
will call on other functions to do scaling, rotation, and translation
within the object in addition to matrix manipulation. Hint: Be sure
to leave the matrix as you found it each time to avoid cascading
effects.
- You must use transformation calls to position the instantiations
in your scene.
- Design and implement an OpenGL program to display these
objects as wire frames.
- 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). (NOTE: Be careful
of your "up vector" with this view.)
- Keep all applicable menus and key controls from previous labs.
- (Note: If you keep your selections between wire frame and
flat shading, you will want to convert your program to use
the glPolygonMode function.)
For a grade of Level 3
- Instantiate 15 objects.
Make the objects "fit" into some kind of
scene using the ROBOTICS theme.
- Use one vertex array per unique fundamental object.
- Design a single function for each unique object. This function
will call on other functions to do scaling, rotation, and translation
within the object in addition to matrix manipulation. Hint: Be sure
to leave the matrix as you found it each time to avoid cascading
effects.
- You must use transformation calls to position the instantiations
in your scene.
- Design and implement an OpenGL program to display these
objects as wire frames.
- 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).(NOTE: Be careful
of your "up vector" with this view.)
- 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.
You will need to use hidden line/surface removal and double buffering
(see below) to make the animation smooth.
- Keep all applicable menus and key controls from previous labs.
- (Note: If you keep your selections between wire frame and
flat shading, you will want to convert your program to use
the glPolygonMode function.)
For a grade of Level 4
- Instantiate 15 objects.
Make the objects "fit" into some kind of
scene using the ROBOTICS theme. .
- Use one vertex array per unique fundamental object.
- Design a single function for each unique object. This function
will call on other functions to do scaling, rotation, and translation
within the object in addition to matrix manipulation. Hint: Be sure
to leave the matrix as you found it each time to avoid cascading
effects.
- You must use transformation calls to position the instantiations
in your scene.
- Design and implement an OpenGL program to display these
objects as wire frames.
- 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 0 in z and y).
- From the left (negative X axis, near 0 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 0 X and Z).(NOTE: Be careful
of your "up vector" with this view.)
- 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.
You will need to use hidden line/surface removal and double buffering
(see below) to make the animation smooth. LI>
- (Note: If you keep your selections between wire frame and
flat shading, you will want to convert your program to use
the glPolygonMode function.)
Special Notes:
- Hidden Surface Removal
- Add to your init() function the following call:
- Change all your glClear calls from:
glClear(GL_COLOR_BUFFER_BIT)
to
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
- Double Buffering
- In the main function, change:
glutInitDisplayMode ( GLUT_SINGLE | GLUT_RGB);
to
glutInitDisplayMode ( GLUT_DOUBLE | GLUT_RGB);
- At the end of your animation loop, just before
a call to glFlush(), put the following:
Enrichment
Look at my mouse examples and attempt
to use mouse movements to move your camera.