CMSC 435/634: Introduction to Computer Graphics

Assignment 3


Due March 14, 2008

Last Change

Tue Mar 11 17:14:24 EDT 2008
Tue Mar 4 18:43:14 EST 2008

The Assignment

For this assignment, you will be modifying your last assignment to construct a forest of trees, then drive a vehicle around the forest. You will not be graded on aspects of the previous assignment for this assignment, but you can get sample OpenGL code to use instead of your own if you choose.

For the environment, you should extend the ground plane to give a large space for navigation. Start your vehicle in the center of the ground plane. Randomly place trees in this space, avoiding any location too close to your vehicle start location or to an already placed tree. You can use a simple 2D distance check (center of tree to center of tree, or center of tree to center of vehicle) to decide if trees are too close. Extra credit: Use a spatial data structure to accelerate your tree/car collision checks. For example, you could use a coarse grid with a list of trees in each grid cell, then limit checks to only the necessary cells.

Your viewpoint should be approximately one meter above the ground. Your vehicle can be represented as a simple rectangular box underneath your viewpoint, such that you are looking over the hood of the vehicle. When moving, your vehicle should stop before running into (or through) any trees. For keyboard navigation, when holding the 'w' or 's' keys, your vehicle should move forward or backward, the 'a' and 'd' keys should turn your vehicle left and right. The arrow keys or mouse should turn your head left and right and tip your view up and down. If you run on the XBox 360, the left joystick will control your car (move forward/back, turn left/right), and the right joystick will control your head (tip up/down, turn left/right).

634 extras

Students in the graduate (634) version of the class should include some amusing multi-frame response to running into a tree. For your multi-frame response, plan a motion path, then move a little way along it each frame. Your animation should be independent of your actual framerate, so where you draw along the motion path in each frame should depend on the elapsed time, not number of frames.

Getting started and submitting your work

You will continue to use the university systems and using CVS to submit your work. Refer to the class CVS instructions for details, but you will need to first check out a copy of your CVS files from the class repository. This will give you the sample files you need to start work on this assignment. Do all of your work in your checked out copy, then check in your submission by the deadline. DO NOT work directly in the repository, if you do, we may not be able to retrieve your assignment and your work may be lost!

Turn in this assignment electronically by checking it into your assn3 CVS directory by 11:59 PM on the day of the deadline. We will use a dated checkout for grading, so you will be graded on whatever has been checked in as of 11:59 PM. Submit a readme.txt file telling us about your assignment. What help, if any, did you receive from books, web sites or people other than the instructor and TA?

Also submit all source and data files we need to build and run your submission. For the OpenGL option, this will consist of your readme, Makefile, C or C++ headers and source files, and some sample grammar files. For the XNA option, this includes your readme, .sln, .csproj and .cs files, as well as any Content directory files, including sample grammar files. We should be able to check out and build your project entirely based on the files you check in. Be sure to comment your code! You will not be graded on the presence or quality of your comments, but we will look at your code. Anything that helps us understand what you did (or were trying to do) can only help. In any case, your programs are expected to be robust and easy to understand.