CS 176 (Winter 2011) | |
Project 4 Description
|
|
|
Due Thursday 2/3/11 8:00pm
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. Your mesh data structure must support minimally the following:
For the second part of this assignment you will implement the following shading techniques to render your mesh structure:
class Mesh { typedef std::vector<Vertex*> VertexCt; typedef std::vector<Triangle*> TriangleCt; // .... some other stuff // This is an STL vector that holds a list of pointers to vertices VertexCt m_vc; // This is an STL vector that holds a list of pointers to triangles TriangleCt m_tc; // .... more stuff } where Vertex is a simple class structure that stores minimally its position, and Triangle stores three Vertex *, i.e., pointers to the three vertices that constitute the triangle. You will most likely have to add more data and functions to those classes to complete Part I of the assignment. 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. (A few links may be dead.) Create a zip or tarball containing all your source code along with either a makefile or .sln file for Visual Studio. Send me a link as to where they can access your zip file. |