Assignment 3: A Hilly Dungeon Crawl

Due: Monday, May 23

This is an extension of the previous assignment. Your dungeon will now provide for terrain that has fluctuations in altitude; different rooms will be at different heights. Ramps will connect the rooms. Also, the rooms may contain objects of different types which you will model with SketchUp. As before, you should be able to move the camera through the virtual space using the keyboard, though for extra credit the movement should be smooth, not discrete. The other big change is that you must make use of light sources and the Phong shading model for the surfaces of the terrain.

Specifications:

Here is a sample input file.

Accessing Sketchup Datafiles

To access the vertex, triangle and edge data in a Google Sketchup exported file, use my SketchUpCollada class. (You can download the entire contents of that project here.)

Graduate Student Requirements (and extra credit for undergrads)

For those of you taking this course for graduate credit you should complete the assignment as indicated above, with the following changes:

Motion of the camera should no longer be integral. The 4 and 6 keys should rotate the camera left and right, respectively, but only at a fixed rate for as long as the keys are held down. Upon release, the camera should remain at its current orientation. Likewise and 8 and 2 keys should move the camera forward and backward, but only for so long as the keys are held down. Not that movement along the ramps may be complicated by this. For each frame of animation, you can calculate the x,z coordinate easily enough, and the y-coordinate will be a fixed amount above the floor at that (x,z) position. But the height of the floor varies across ramps....

The program must still disallow the camera from passing through any walls. This is a simple form of collision detection, for each frame of animation, calculate whether the movement of the camera would take it into a space that is a wall. If so, do not move the camera.

Add a sky-dome or sky-cube to your program.

Hints:

Play with the diffuse, ambient, and specular coefficients to get a nice looking effect. Add the texture maps only after you've got most stuff working.

Submission:

Submit your source code to the appropriate dropbox in emuonline.edu.