views:

231

answers:

4

How do I take a 3D model that I created in 3D Studio Max and put it into my Winform C# program and make it spin? I'd prefer not to use DirectX if possible. I don't want anything complex. I simply want my model to rotate along the X axis. Thats it.

Thanks

A: 

Make a gif animation out of it. Follow the following post on showing a gif animation in WinForms.

http://stackoverflow.com/questions/165735/how-do-you-show-animated-gifs-on-a-windows-form-c

Hasan Khan
Good suggestion, except I'd like it to be dynamic. Meaning that the user can drag the model in any direction along the axis. How would I do this?
icemanind
A: 

For something non interactive:

Export the animation to an AVI and embed that in your form:

http://stackoverflow.com/questions/332117/embedding-video-in-a-winforms-app

It's not really what I'd recommend, but it's an alternative to creating an animated gif.

For something partially interactive (i.e. allowing limited movement):

I've seen QuickTime movies that you can control with the mouse. There's an example on this page. It's not 3D though.

For something fully interactive:

You need a 3D rendering engine of some sort and that does (usually) require DirectX or OpenGL. However, if you're only dealing with simple objects you might (repeat might) get away with a software renderer.

ChrisF
Good suggestion, except I'd like it to be dynamic. Meaning that the user can drag the model in any direction along the axis. How would I do this?
icemanind
@icemanind - well if you'd said you wanted interactivity...
ChrisF
Sorry I should have been more clear
icemanind
A: 

You should use a 3D rendering engine for C# Something like

http://axiom3d.net/wiki/index.php/Main_Page

http://www.codeproject.com/KB/GDI-plus/exoengine.aspx

http://irrlicht.sourceforge.net/features.html

http://freegamedev.net/wiki/Free,_cross-platform,_real-time_3D_engines

I have never used any rendering engines but for your requirements (letting the user move the object) i think a 3D engine would do. But perhaps this is over kill

Ranhiru Cooray
+1  A: 

If you want it to be dynamic, then the simplest option would be to render out an animation of the object rotating, but make each frame a separate file. Then you just show the correct image based on how the user is dragging the mouse. If the user drags the mouse to the right, then increment the frame and show the next image. If moving to the left, decrement the frame.

David