| CS 176 (Winter 2008) | |
Project 2 Description
|
|
|
|
Due Monday 1/21/08 23:59
We talked about meshes in lecture this week. For the first part of this assignment, you will implement your own triangle-based mesh structure.
We talked in lecture about basic data structures and some methods and tricks useful in constructing meshes. You are not obligated to follow our scheme. The underlying structure and implementation of the mesh is entirely up to you, but your mesh should support topological and geometrical operations gracefully, especially on high triangle count models! Refer to lecture slide 10-13 for a few examples of such operations. Spend some time designing your structure-you might choose to use this mesh implementation for later assignments involving meshes. Keep performance in mind, but don't obsess over code optimization. Hint: you might want to consider having an edge structure as well, even though the edge information is implicitly contained in the face. You will need a minimal edge structure during topology construction in any case. Consider keeping it around beyond topology construction.
For the second part of this assignment you will implement the following shading techniques to render your mesh structure:
For this assignment, we will provide you with a simple viewer coded in C++ with
OpenGL. Download it here. It contains a simple vec3 and quaternion library, and handles OpenGL
initiation, keyboard and mouse UI, rotation, zooming, and rendering of the
model in wire-frame. A basic .obj parser is also included to extract geometric
and topological data from an obj file. It rolls the data into the following
simple mesh structure:
Each CVec in m_pVertices stores the location of a vertex in the mesh. Every unsigned int in m_pIndices refers to an index in the m_pVertices. Every consecutive, non-overlapping triplet of unsigned ints in m_pIndices specifies a triangle face in the mesh, i.e., the nth face in the mesh will have vertices m_pVertices[m_pIndices[n*3]], m_pVertices[m_pIndices[n*3+1]], m_pVertices[m_pIndices[n*3+2]]. You may of course choose to write your own openGL viewer and obj parser. Your viewer will need to handle rotation and zooming of the model by mouse and have some menu or key options to handle switching between shading models. Sample meshes to test your datastructure can be found here. Create a zip or tarball containing all your source code along with either a makefile or .sln file for Visual Studio. Send the TAs a link as to where they can access your zip file. |