The Mesh Project – README Note: The code is provided with absolutely no guarantees. It is supposed to help you implementing the project, and it was prepared on a voluntary basis. By all means, it is NOT guaranteed that the code is entirely robust and bug-free. Also, please accept in advance my appologies for not very good modularity/object oriented. Coding under hard time constraints is not good for design :-) ------------------------------------------------------------------------------------- What is provided: The file MeshProject.zip contains a working C++ project developed in Visual Studio 6.0 under Windows 2002. The name of the project is Mesh (open the mesh.dsw file). The rendering is realized with OpenGL, gui is handled by GLUI. There is a heavy use of STL (mainly vector). Structure of the project: ------------------------- Open the project in Visual Studio and look at the files and folders in FileView window. * The folder "Adi files – VRML parser" contains all the code that reads VRML. Don’t touch it unless you really know what you are doing. * In "external dependendencies" you will see a lot of files (in UNIX naming style). They all have to do with the camera and mouse handling, encapsulated in the library gtbmous.lib (the gtbmous.lib file is included with the project). Don't touch these files at all. * The folders "My Header Files" and "My Source Files" contain some classes that are needed for the mesh data structure. You may (and should) add methods as your implementation requires. Be careful if you modify the interface, because some classes are dependant of each other, and also the VRML parser relies on the interface. From now on, I will only refer to files contained in these two folders. * The main() is in the file render_main.cpp. In this file the gui is built and the rendering is handled. * The mesh data structure is represented by TexturedMesh class. A TexturedMesh object contains many members. The basic ones are m_vertices and m_faces (vertex coordinates and list of triangles, accoringly). In addition, there are some useful data structures, such as list of edges (m_edge_list), list of faces for each vertex (m_vertex_to_triangles_map), the dual graph (m_triangles_adjacency_list), etc. All these structures are fairly well commented, so just look in TexturedMesh.h file. Remark: TexturedMesh is also capable of handling textured meshes (there are some members for that, like m_uv_coordinates). In your project this is irrelevant, so you can simply disregard them. Just in case: the VRML parser is capable of reading meshes with one texture map, but the rendering doesn't support texture (yet). Methods: The TexturedMesh class can read from a VRML file and write itself to a VRML file. It also supports some basic methods like GetBoundingBox() or GetNumberOfVertices(). All the mesh data structures (such as edge list, etc., excluding m_vertices and m_faces) need to be initialized explicitly by calling an appropriate function (see "Auxiliary functions" in the class header). The order of calling these methods is important because they rely on each other (see comments before the implementation of these functions in TexturedMesh.cpp). The rendering methods for TexturedMesh are implemented in TexturedMeshRendering.cpp. The rest is in TextureMesh.cpp * Other classes: The most important classes are Point3D (has many useful operations on 3D points/vectors) and Tripplet (manipulations on triplets of indices). The class Serializable is an interface class that enables streaming (operators << and >>), most of other classes inherit from it. The files Real.h and Real.cpp contain type definition for real numbers (currently defined as double) and some operators. The code is pretty self-explanatory and commented. If you still have trouble understanding what’s going on there, you can contact me: Olga Sorkine sorkine@tau.ac.il Good Luck!