A Sample Program by Jonathan Kreuzer Stage #4: http://www.3dkingdoms.com/weekly/weekly.php?a=34 Painting onto the mesh added, as well as various other options. 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. Displays the mesh in a viewport that can be dragged or rotated. Loads a single tga texture. Can display the texture with a UV wireframe. Allows painting on the mesh. ***Using*** Left Mouse button : Paint on texture. You can also hold the button and drag to paint. Alt + Left Mouse button : Pick the brush color from the texture. [ and ] keys : Increase or decrease the texture size. Drag Right mouse button : rotate the view Drag Center button : pan the view Drag Shift+Center button : zoom in or out Menu->Viewports Toggles: Wireframe, Texturing, Lighting, Normals, Vertices Menu->Texture Texture View Mode(toggle), Reload Texture ***Compiling*** I test compiled with Microsoft Visual C++ 2005 and MSVC 6.0. It uses OpenGL for rendering, so you'll need to include 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 paint.cpp : Brush / Texture updating 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.