Coding Animation of Armature

Started by
1 comment, last by hunpro 11 years, 1 month ago

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?

Advertisement

bump

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.

This topic is closed to new replies.

Advertisement