CMP 160 -- Programming Assignment 5
Due date:
10:00am TUES, 11/16/99
Objectives:
Learn viewing transformations and texture mapping.
Note that the assignment below is built upon your earlier programs.
To Do:
-
First requirement is to allow user to toggle between orthographic
and perspective projections. Select a reasonable combination of
view volume and projection plane distance to camera so that switching
between the two modes is not too drastic.
-
Second requirement is to allow the user to change his/her viewpoint
within the world.
Try to minimize the use of xform sliders as much as you can.
-
Final requirement is to apply some texture image onto the object.
Experiment with different texture images and different mapping
strategies. "xv" is a nice program if you need to do simple image
editing or converting among different popular image formats.
-
As in earlier programs, allow the objects and lights to be manipulated.
Notes:
-
Use the data files in the class directory:
/afs/cats.ucsc.edu/class/cmps160.f99/data.
If you are using other data sets,
be sure to include them with your submission.
-
Rotating viewpoints is illustrated by the following
java3d online example
.
Hopefully, this will be viewable on the nt's and suns...
If not yet, you can also try "appletviewer".
At least the java3d source is viewable and maybe that might help.
-
Another java3d example, though a bit buggy, illustrates the
viewing system
.
-
There's a number of examples in
/afs/cats.ucsc.edu/class/cmps160.f99/openglbk
that illustrate how to do texture mapping.
Obviously, image files can be used in place
of generating own textures.
-
Also take a look at some great examples in
/afs/cats.ucsc.edu/users/i/yiff/src/homework/cmps160/tutor.
Specifically, look at "texture" and "projection" to get a better
understanding of texture mapping and viewpoint manipulation in OpenGL.
-
A simple
texture mapping tutorial at the Univ of Alberta includes how to
read in a raw rgb file.
-
Some useful OpenGL functions (see the man pages):
glMatrixMode, glFrustum, gluLookAt, gluPerspective.
-
Submission must be done using the submit or xsubmit utility from CATS.
Run "quickhelp submit" on a CATS machine to find out more info.
Create and submit a subdirectory called "prog5". It should
contain all the files you have in make your program compile/run.
This includes folks using Windows/NT/MAC environments.
-
Grading guide
Last modified
Monday, 08-Nov-1999 13:13:19 PST.