MP1: Mesh Rendering

Assigned: Monday, February 2, 2009

Due: Monday, February 16, 11:59pm

During the course of this semester, we will make extensive use of OpenGL -- a powerful cross-platform 3D graphics programming interface. It is used in a diverse range of applications, from CAD to games like Quake III. The goal of MP1 is to become familiar enough with OpenGL and GLUT to write a small program that displays a mesh. In this project, you will learn : We are providing you with a simple starter code. It demonstrates how to get a basic program up and running with GLUT. The source code is original for Visual Studio 2005 format, but it should be very easy to port the code for other platform/compiler. You can use this program as a starting point and add more functionality such as OBJ file reader and OpenGL display function to complete the MP requirements. 

All our example code will be written in C++. We assume that you already know C/C++. While we will not use any sophisticated C++ features, you should certainly understand the basics of control flow, method invocation, and class definition. Unfortunately, we simply do not have the time to provide any kind of substantial help in learning to program in C/C++, so it is your responsibility to learn (or refresh your knowledge of) the C++ skills necessary to complete this project.

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.

These mesh data files are stored as indexed face sets, meaning the vertices are stored as a list, followed by the faces which consist of ordered indeces of three of the vertices. This way each vertex need only be stored once, and referenced multiple times, once for each triangle that uses it. The format is simply a list of vertex coordinates, one per line, beginning with 'v' and followed by the xyz coordinates of the vertex, delimited by spaces. The vertex position list is followed by vertex color list, also one vertex color per line. It begins with "vc" and followed by the indices of RGB color. The color list is then followed by face list, one face per line, beginning with 'f' and followed by the indices of three (or more) vertices. The indices are base 1, so the first vertex is indexed by '1' and so on.

For example :

v 0.1 0.2 0.3 ...

vc 0.8 0.8 0.8...

f 1 2 3

f 2 3 5 ...

Here the three floating numbers "0.1 0.2 0.3" after the 1st "v" is the xyz position for the first vertex, and the numbers "0.8 0.8 0.8" after the 1st "vc" is its RGB color. The positions and colors for other vertices are determined accordingly. Similarly, three integers after the 1st "f" are vertex indices for the first face. Here it means the face is composed by vertex 1, 2, and 3.

    BunnyHoleFill

Requirements

Grades will be assigned according to the following criteria :

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.