CMP 160 -- Programming Assignment 3
Due date:
10:00am THUR, 10/21/99
Objectives:
Learn and apply 3D transformations.
Also learn a little bit more about xforms
(or your favorite GUI).
To Do:
-
Write a program that reads in 3D object files
and displays them in wireframe (skeleton drawing).
The following directory on the cats/sun machines
has examples of 3D data files that you can use:
/afs/cats.ucsc.edu/class/cmps160.f99/data.
Note that you may also include file readers
or importers of other 3D file formats.
If you do, be sure to include a sample data set
with your submission.
The minimum requirement for data format is the
one in the above directory.
Object must be displayed centered on the viewport.
Hint: you'll need to adjust the parameters to glOrtho
depending upon the size of the object.
-
After reading in an object file, allow the user to
manipulate it (i.e. translate, rotate, and scale).
This can be carried out by mouse movements,
or withs sliders and/or dials from a GUI.
Manipulation should be relative to the
centroid of the object.
Minimum requirement is translation, and
rotation/scaling about the object's centroid (in world space).
+3 bonus for object rotation in screen space
(similar effect to java3D example below).
-
Include either the 3 world axes or
3 coordinate planes as a frame of reference.
Allow the display to be toggled on/off.
-
Beyond the basic requirements above,
you may also want to allow multiple objects to be
loaded in and positioned in your world.
If so, take advantage of the picking routine
from prog2.
-
Like your earlier programs, it's always nice to have
things behave properly even after your "window" has
been moved and/or resized.
Notes:
-
The data files in the class directory are: "coor-poly" files.
Each object is defined with 2 files: the "coor" file specifies the
coordinates of the object, and the "poly" file specifies the
connectivity or the polygons of the object.
The following code snippet shows how to read in this data format:
readdata.c .
-
key.c
illustrates how to detect and handle key stroke events.
Accompanying files are:
graphics.h ,
gui.h ,
gui.fd ,
gui.c and
makefile .
-
Object rotation is illustrated by the following
java3d online example
.
This does not seem to work properly on nt and suns yet,
maybe later..
-
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 "prog3". 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, 11-Oct-1999 15:17:30 PDT.