PDA

View Full Version : Animation



arablau
07-04-2012, 11:56 AM
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

Bloodust
07-04-2012, 12:35 PM
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.

arablau
07-04-2012, 01:47 PM
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.

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!

Kopelrativ
07-05-2012, 01:50 AM
Have a look at the Assimp (http://assimp.sourceforge.net/)library. 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 (http://ephenationopengl.blogspot.de/2012/06/doing-animations-in-opengl.html).

Dark Photon
07-05-2012, 11:52 AM
...I am asking for what file formats do support animation ... I ... would like a more hands on, comprehensive understanding of this process with as little 3rd party software as possible.

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 (http://www.amazon.com/Game-Engine-Architecture-Jason-Gregory/dp/1568814135/ref=sr_1_1?ie=UTF8&qid=1341514685)-- 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 (http://www.amazon.com/Game-Programming-Gems-CD/dp/1584500492) (also in Best of Game Programming Gems (http://www.amazon.com/Best-Game-Programming-Gems-DeLoura/dp/1584505710/ref=sr_1_1?s=books&ie=UTF8&qid=1341514816&sr=1-1&keywords=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:



FBX (http://usa.autodesk.com/fbx/) (Filmbox; Autodesk publishes an SDK for this (http://usa.autodesk.com/adsk/servlet/index?siteID=123112&id=7478532))
MD5 (http://tfc.duke.free.fr/coding/md5-specs-en.html) (Doom 3 Models),
IDM/IQE (http://lee.fov120.com/iqm/) (Inter-Quake Model/Export)
COLLADA (http://www.wazim.com/Collada_Tutorial_1.htm)


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.

arablau
07-09-2012, 10:09 AM
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 : http://www.wazim.com/Collada_Tutorial_1.htm

puneet123
07-19-2012, 10:31 PM
If u can explain what exactly are you looking for i can send you complete animation tutorial.:)

Animation Company (http://showboatentertainment.com/animation-production-company.html)
Animation Studio in Delhi (http://showboatentertainment.com/blog/animation-studios-in-delhi/)