Assigned: Tuesday, February 17, 2008
Due: Monday, March 2, 11:59pm, 2008
We are providing you with two sample terrain models for this project: one for the Grand Canyon and one for the Puget Sound. They are both in OBJ file format. Note that different to the models provided in MP1, these models do not have any vertex color information nor "vc" labels. However, the terrain models come with texture coordinates for each vertex. Each texture coordinate begins with "vt" and a pair of 2D texture coordinates. The texture image is also included with the model. The image is in .PPM format. You may refer to here for an introduction of PPM format. We also provide you a sample code fragment for PPM loading. Feel free to use/modify it in your code so you can focus on OpenGL part of this MP.
To help you in preparing for the bonus features, we are providing you with a selection of sample mesh models. You are free to use all, some, or none of them. Note that different to the models provided in MP1, these models do not have any vertex color information nor "vc" labels. You will need to calculate the normal vector on your own and enable lighting in this MP.
All students must implement the following required features.
Required Features
[40 points] Terrain Rendering
- You should render one terrain model during every run of your program. The terrain should be displayed as a 3D triangle mesh. Do NOT use the wireframe mode. The terrain model needs to be textured mapped using the provided image.
- You should be able to draw the terrain meshes with lighting enabled, with a minimum of two point lights. You should implement both flat shading and smooth shading. For flat shading, one normal is needed for each face. For smooth shading, calculating normals at mesh vertices is necessary. This can be done by averaging the normals of the faces surrounding a vertex.
[50 points] Flight Simulator
You should use a perspective camera model. The camera movement/interaction should simulate a flying aircraft. The user will control the turn/pitch of the airplane through the arrow keys.:The key to getting this done correctly is making sure the transformations are applied in the correct order. If you pitch the plane up or down, make sure the plane is moving in the direction the plane is facing, not in its previous direction. If you roll to the left and then pitch, make sure the plane turns to the left and not straight up.
- The airplane should automatically move forward at a fixed speed.
- User can adjust the speed of the plane with keyboard input (+/- keys, for example).
- Pressing the left (right) arrow key will make the plane turn to its left (right).
- Pressing the up (down) arrow key will cause the airplane to pitch up (down).
- Pressing the A/D keys will cause the airplane to roll left/right.
[10 points] Code Design and Documentation
Your code should be well designed and well written. It should be easy to follow the logic of your program. A readme.txt should explain the features and special instructions ( if any ) to run your code.
Bonus Features
The following features are counted as bonus points and are not required for this MP. The bonus points will not affect the final letter grade cut-off and therefore you will not be penalized for not implementing these features. However, you may elect to implement them and receive up to 20 points of bonus points.[+20 points] Multiple Objects Renering/Manipulation
Your program should be able to load and render multiple (at least three) sample models in addition to the terrain. These models should be scaled to the right size and be placed appropriately. For rendering, make sure that your object surfaces exhibit both diffuse and specular reflection. In addition, 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 camera configuration should remain fixed during such manipulation. The following user interactions must be supported:
- Define the velocity vector of the selected object. The object should start to move along the velocity vector.
- Adjust the direction of motion by applying rotation to the velocity vector. The same rotation should also be applied to the object so that the object appears to turn. We do not have a unified interface for this part.You may choose a reasonable method for specifying rotations, such as keyboards or CTRL-dragging the mouse.
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.
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 percent reduction for every 24-hour period after the deadline.