Animation

Hi everyone,

I am new to OpenGL and the forums and have searched for some topics on animating objects without finding any conclusive information for my question.

I use 3DS Max to model my 3D content and animate it with keyframes. (I am still relatively new to the animating part).
I can export these models to most file formats and have been working on loading .obj files to render my statjc models with OpenGL.

My question is, how do I export models AND animations from 3DS Max so that I may render these animations with OpenGL?
More specifically, what file format is most-widely used in the industry to store animation data, and how is this data stored?
How would I then go about parsing this data and applying the proper transformations to my vertex data in OpenGL to create the animation?

I have looked at lib3ds but would like a more hands on, comprehensive understanding of this process with as little 3rd party software as possible.
Also, in a similar post I read about the Wavefront Animation Studio software suite for animating .obj files, but would like to create my animations in 3DS Max and export them from there.

Thank you in advance for all your help!

  • Alex

As far as I know .obj doesnt support animation.
As for loading the animations and models, I suggest using assimp http://assimp.sourceforge.net/.
You can get the model and animation data out quite easily.

[QUOTE=Bloodust;1239633]As far as I know .obj doesnt support animation.
As for loading the animations and models, I suggest using assimp http://assimp.sourceforge.net/.
You can get the model and animation data out quite easily.[/QUOTE]

Yes, I know .obj does not support animation. That is why I am asking for what file formats do support animation / can animations be stored in a separate file.
I don’t know much about how animations are stored so I don’t really know how to ask the questions.

Can you explain to me the concepts behind storing animation data?

Thank you for the link! I’ll look into it in a moment!

Have a look at the Assimplibrary. It can load many of the 3D model file formats.

I use the Blender tool and export animations in Collada (.dae) format.

In a “real” project, you probably don’t want to use Assimp, but rather a proprietary format that only supports just what you need. In that case, Assimp can help you to convert to that format.

Be prepared that animation is a somewhat complex problem, which requires a lot of effort if you want to do it all yourself in OpenGL. See my experiences at: Doing animations in OpenGL.

I think your goal of having as little 3rd party software in the loop as possible is a great goal. I would strongly suggest first getting your head solidly in how skeletal animation math works (what transforms are involved, what they’re named, how they’re composited, etc.) before you dig into this, or you’re likely to quit in frustration or pull your hair out until you decide to go back and figure out the basics.

A lot of the skeletal animation info available on the net is just “so-so” to complete garbage (many of the so-so ones assume knowledge of things you might not know or use odd or confusing names for things), so you can spend a lot of time here if you don’t know where to look. Would suggest you first read Chapter 11 of Jason Gregory’s Game Engine Architecture– or if you’re impatient, just Sections 11.1 - 11.5 (you can pick up the rest later). For a short-but-good tutorial on the transforms specifically (Gregory covers this well also), read Chapter 4.2: Filling the Gaps: Advanced Animation Using Stitching and Skinning from Game Programming Gems (also in Best of Game Programming Gems).

If you have any questions, feel free to ask them here (should probably post on the “Math and Algorithms” forum though) – there are several folks on the OpenGL boards that have done skeletal before.

As to your specific question about formats, there are some common 3D file formats you could use for skeletal animation interchange. These include:

[ul]
[li]FBX (Filmbox; Autodesk publishes an SDK for this) [/li][li] MD5 (Doom 3 Models), [/li][li] IDM/IQE (Inter-Quake Model/Export) [/li][li] COLLADA [/li][/ul]

and then of course the native save formats for your favorite 3D skeletal modeling packages (e.g. Blender, Maya, Cinema4D, 3DSMax, etc.). I haven’t done a deep analysis of any of them. Pretty much wrote my own – easier to tailor to the specific needs and capabilities of your engine that way (once you understand the guts it’s much easier to just avoid the bloat/limitations of an existing format and roll your own).

…can animations be stored in a separate file.

Sure thing. In fact, that’s highly encouraged! You’d want to do this for instance to support skin retargetting (i.e. applying the same animation set to different skin meshes).

I don’t know much about how animations are stored so I don’t really know how to ask the questions.

Can you explain to me the concepts behind storing animation data?

This isn’t a “quick tutorial” type subject. I’d suggest you spend some quality time carefully reading one or both of the above sources I mentioned, and then if you have any questions, feel free to post them here and we’ll try to help you out. Probably best to post in the Math & Algorithms forum though as this isn’t really an OpenGL specific question.

Thank you for the excellent reply Dark Photon. That helped me out quite a bit.
I’ve decided to use COLLADA for the project I am working on now since I can quickly import the mesh data and render it with openGL so that I can at least make a little bit of progress as I learn about skeletal animation.

I found this tutorial (It may have been posted somewhere on this forum, I don’t remember) which I think will be helpful : Collada Tutorial – waZim

If u can explain what exactly are you looking for i can send you complete animation tutorial.:slight_smile:

Animation Company
Animation Studio in Delhi