3D Rotating Objects Demo

CodeGuru content and product recommendations are editorially independent. We may make money when you click on links to our partners. Learn More.

This demo show how to do transformations on, solid and wire-frame, 3d objects.

Image 1

The class file does all the grunt work for you. the only calls the user makes to the class is to "LoadObject", if the user wants to move or rotate it then they call the "SetRotations" and "SetTranslations" functions. There are also properties that allow the user to get the current translations and rotations for each axis. After the user has done all that, simply call the "RenderObject" routine and bamm!

In the "LoadObject" function you must supply a file path and an device context (picture box) along with initial values you would like set, such as the rotation, scale factor and it’s world position.

In the "SetRotations" function there is three parameters. One for the X, Y and Z values. Only supply the one that you want to change. The same goes for the "SetTranslations" function.

There are no parameters for "RenderObject". Enjoy 🙂

Download Zipped Project File (16k)

More by Author

Get the Free Newsletter!

Subscribe to Developer Insider for top news, trends & analysis

Must Read