MP1: War of the Meshes

Assigned: Thursday, February 9, 2006

Due: Monday, February 27, 5:00pm


In this project, you'll be implementing a simple program for displaying terrains along with mesh objects , such as an animal or a spaceship. After completing this project, you should have learned: We are providing you with a simple starter kit. It demonstrates how to get a basic GUI program up and running with our support libraries. It also shows you how to draw a single polygon that can respond to user command(mouse input). Reading through the comments in the demo will be very helpful. Included in this archive are build files for Linux. This starter kit is built on top of the ligfx support library. You may need to add menus or text file support to your program as needed, and the support library has documentation that will help you. We encourage you to read through it. In the "Online documentation" section, the "Minimalist GUI framework" (MxGUI) part and the Simple GUI Program part maybe a good place to start.

If you have trouble with any part of the project preparation, please see an instructor or TA during their office hours. Alternatively, post a message on the course newsgroup (news.cs.uiuc.edu/class.cs418). We usually check the newsgroup regularly and will attempt to respond promptly to questions posted there.

Using other systems or frameworks

Because libgfx runs on a number of different platforms, using it ought to allow you to develop your code on one system and port it to another. However, we only officially support the library on the Linux machines in 0216 Siebel, so if you run into machine- or platform-specific problems on another machine, we may not be able to answer your question. Additionally, you must make sure your code does compile and run on the machines in 0216 Siebel.


Sample Models

To help you in preparing an interesting project, we are providing you with a selection of sample mesh models. You are free to use all, some, or none of them. We are also providing you with some sample code for reading OBJ files. This is a very limited OBJ parser, but it should be able to handle all of the OBJ files we have provided.



Terrain Data

We are providing you with two sample datasets for this project: one for the Grand Canyon and one for Puget Sound. The data itself consists of two parts: a grayscale height map and an RGB color map. These are both just TIFF files.

Each dataset is described by a ".terrain" file. Here is an example:

60 40 4096
data/gc_z.tif
data/gc_tex.tif


This file describes the Grand Canyon data set. The first line provides
the dimensions of the data set, specifically the:

- pixel_spacing of original data (s) [60m between samples]
- height_unit (h) [40m per unit gray level]
- width of original data (w) [4096 pixels]

Following this information are the filenames of the height field and the
texture image, respectively.

Since the terrain data we use is a downsampled version of the original data,
so the actually pixel_spacing need to be calculated from the original spacing
like this:

Suppose the width of gc_z.tif is w'. Then we know that the current data is
downsampled from the original data at a rate of r=w/w'. So the current pixel
spacing should be s'=s*r, and h is unchanged. This means for a pixel (i,j),
its world coordinate should be:

( s'*i, s'*j, h*z(i,j) )


You can find the original data at:
http://www.cc.gatech.edu/projects/large_models/gcanyon.html

gc.terrain               gc_z.jpg          gc_tex.jpg
puget.terrain         puget_z.jpg           puget_tex.jpg


Requirements

All students must implement the following required features.

[30 points] Terrain Display

[30 points] Object Rendering

[30 points] Camera Control
You should use a perspective camera model. The user should be able to interactively move the camera around this world. The following camera motions should be supported:

All camera movements should be controlled interactively, either via the mouse or via key presses. You can use controls that is most natural to you, and need not follow those in the demo program. Make sure to document them clearly in your README file.

In order to receive full credit, 1-unit graduate students must also implement the following additional features.

[25 points] Object Manipulation
The user should be able to choose one of the displayed objects, not including the terrain, and control the motion of that object only. The viewpoint and the viewing direction should remain fixed during such manipulation. The following user interactions must be supported:

The final components of your grade will be the following. Notice that this brings to total number of points for this project to 125 for 1-unit graduate students and 100 for everyone else.

[10 points] Code Design
Your code should be well designed and well written. It should be easy to follow the logic of your program.

Tips and hints

Handing in your Project

Important: Follow all handin instructions carefully. You may lose most or all points for failure to follow these instructions or if you do not hand in all required files.

You must turn in the following files:

To actually turn in your finished project, follow the hand-in instructions that we have provided.

Grading

Code-sharing, working together with peers, and copying code from other sources are only allowed under restricted conditions. Make sure you read the code-sharing policy for details.

Significant reductions will be imposed for projects that do not compile. If a project is handed in late, there will be a 20-point reduction (25 points for 1-unit grads) for every 24-hour period after the deadline.