A Sample Program by Jonathan Kreuzer Stage #3: http://www.3dkingdoms.com/weekly/weekly.php?a=33 Fleshed out meshes by adding texture mapping and lighting. Stage #2: http://www.3dkingdoms.com/weekly/weekly.php?a=19 Added triangle & marquee selection, updated viewport and mesh classes Stage #1: http://www.3dkingdoms.com/weekly/weekly.php?a=16 Created framework, demonstration of line-mesh intersection ***About*** This is just a little sample program. Hopefully someone might find it useful. I plan to develop more sophisticated samples using this as a base. Possible this might eventually become a useful program. I haven't had a chance to do much testing, but everything seems to work. ***What it does*** Loads a mesh made of vertices and triangles. Loads a single tga texture. Displays the mesh in a viewport that can be dragged or rotated. Allows selection of triangles by clicking, or dragging for marquee selection. ***Using*** Drag Right mouse button : rotate the view Drag Center button : pan the view Drag Shift+Center button : zoom in or out Left click - Selects the closest front facing triangle at that point of the screen Drag + Left button - selects all triangles at least partially within the selection rectangle Holding Ctrl - Adds to selection Holding Alt - Subtracts from selection Menu->Viewports Toggle Wireframe : render mesh solid or in wireframe Toggle Lighting : render mesh lit or unlit ***Compiling*** I compiled with Microsoft Visual C++ 2005. I haven't tested with any other compilers yet, except MSVC 6.0. It uses OpenGL for rendering, so you'll need to add these libaries: opengl32.lib and glu32.lib ***Files needed in the project*** winmain.cpp : Win32 stuff + Initialization + RenderFrame function mesh.cpp : Mesh Class ( load / select ) texture.cpp : TGA texture loader viewport.cpp : Viewport Class + Selection Class intersection.cpp : 3D Math helper functions for selection & collision detection renderInterface.cpp : Used for all the rendering, currently uses OpenGL linemeshtest.rc : Windows resource file ***Data Files*** meshhead2.dat : Mesh data file. Stores vertex positions, vertex UVs, and triangle indices. headiff.tga : The diffuse texture map for the mesh head.