Sample Stage #1 Apr 27, 2006
I use code from previous articles, and also code from my
selection tutorial.
What the program does
This program loads and displays a wireframe mesh using OpenGL and the Win32 API. You can rotate the viewing direction by dragging with the right mouse button. Clicking the left mouse button creates a ray into the screen at that location, and this ray is collision tested against the mesh, and the points of intersection are marked visually. This could be used for selecting the mesh, or selecting individual triangles.
Code Download
Sample1-Mesh_Line_Intersection.zip ( 19KB )Included are all the .cpp and .h files, the .rc file, a readme.txt, and meshhead.dat. There is no project file or exe. Eventually I may add these. I haven't had a chance to do any portability/compatibility testing yet.
Future Sample Programs
Now that I have a base to work from, future samples should be easier to make. Next stage I'll add area selection, or actually include some optimizations. I also might try to slowly build it into something that's actually useful, and for that I'll need to add a lot to the mesh class and improve the user interface.
|