Computer_Science
 Home | People | Curriculum | Projects | Resources | Media

Computer Graphics

CMSC 212

Haverford College

Fall 2003

Lab 3

Friday, October 24

General 3D Rendering of Polygon Meshes

This project generalizes work from the previous lab assignment, and should not be started until the previous one is completed successfully (see instructor a more precise definition of "successfully"). In fact, many of the labs build on each other, so proper programming organization and documentation are essential throughout the course. You may want to return to the previous lab and reorganize it so it is simpler to extend.

Design and implement a program to accept text input for a local file named "universe.ent" that dictates the camera and a world consisting of a set of polygon-meshes, where each mesh is definined a in a separate file (also with the ".ent" suffix). The general format of the universe.ent file is given here:

camera                  //string
e.x e.y e.z
l.x l.y l.z             //9 doubles
up.x up.y up.z
projection type         //string(parallel || perspective || frustum)
//if parallel:
xmin xmax
ymin ymax               //6 doubles
zmin zmax
//if projection:
width
height                  //3 doubles
distance from camera
//if frustum
xmin xmax
ymin ymax               //3 doubles
zmin zmax
num of objects          //int
for each object, a filename (.ent)

The format of a polygon-mesh text file is given here (.ent) is given here:

polygon-mesh            //string
number of faces         //int
//for each face:
number of vertices      //int
//for each vertex:
x y z                   //3 doubles

Your program should support parallel and either frustum or perspective projections. Sample universe files will be made available. You are welcome to use OpenGL/GLUT calls, or build your own functions. You should assume that the set of meshes can be of size >= 0, so some list of objects is advisable.


Links for CS212 -- Other CS212 Assignments: 0 1 2 3 4 5 6 7

Haverford College Page maintained by John Dougherty, David Wonnacott, and Rachel Heaton.
Computer Science Department, Haverford College.