Download source files - 51 Kb
This sample teaches you how to create an OpenGL based 3D Drawing application
using the MFC library. It shows how to setup the View's class for OpenGL by using special
setup methods that would enable the view window to show 3D shapes.
The sample MFC program demontrates how to setup OpenGL with MFC. It also demonstrates how
to make 3D Shapes using the
aux... functions, for example 3D Sphere
or 3D Teapot. It also shows the very important Hit Selection process in MFC with OpenGL. You can click the
shape you want to select it, then it is selected and reported with a message dialog.
- By using the Command Toolbar, you can change program flow mode to Selection, Rotations or Translation modes.
- While in Selection Mode, with Left Mouse click on the 3D Shapes in the scene will result in selection and report the shape.
- When in Translation Mode, you can move the scene around every where. Also you may Zoom In & Out by Right Mouse button pressed and moved.
- When in Rotation Mode, you can rotate the scene around any where. Also you could toggle the Rotation Axes between X, Y or Z by pressing the TAB key.
- Toggle the Camera View Angle to X, Y or Z.
- Toggle the Camera projection type between Perspective or Ortho.
- Toggle Show or Hide axis.
- Change the Draw, Shading and Lighting Orientation from the Draw Mode menu.
Notes & Credits:
The source code for the Camera, Scene and Co-Ordinate axis classes are from the sample application
posted on www.codeguru.com's OpenGL link. Please ckeck the sample.
The application requires opengl32.dll for windows which can be
obtained from www.opengl.org.