Sign in to follow this  
caibbor

Coding Animation of Armature

Recommended Posts

I've been working on a 3d engine from scratch for a while now. I've got my own model format with an export plugin for blender, and models are importing just fine in game. I'm working with a test model - a Hellknight imported from Doom3 and exported to my own format. The mesh draws as expected in my engine. But now I'm designing animation.

 

Basically, I'm not sure the right way to go about this, either:

 

A.) I'll export the skeleton with each bone pose (in world space, not relative to any other bones) as an array for each frame - even non-key-frames. this way, I can just set bone pos and be done with it. However, this will take lots of memory and more disk space than option B or C.

 

B.) I do the same as above, except export only keyframes, but this time interpolate between bone vertex positions. With this, we'd need more informatiion and processing to do the interpolating so that bones/mesh doesn't deform improperly, since point A to point B would need to be on a curve, not linear. This also would have to be relative to it's parent bone.

 

C.) Same as option B, except bone head/tail positions will be relative to the parent bone's tail position.

 

What's the standard way of doing this in decent game engines?

Share this post


Link to post
Share on other sites
Old MD2 format does something like you said in B i think.I just did the same thing days ago (exporting with own plugin from Blender into my own engine). I export keyframes only for every bone in bone space, and in the engine i use 'hardware skinning' to do the animation. This means building a matrix tree from interpolating between two keyframes on the cpu. Then upload the matrix list for vertex shader which does the transformations with vertex weights and blendindices. This is pretty standard i think, and with this you can do other effects like IK or ragdoll effects. Edited by hunpro

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this