Skip to main content
gamedev.net
🔒 Locked 🎮 Unity

MD5Anim question

Started by ReKlipz Aug 8, 2005 at 5:05 PM 1 replies 1.8k views
Original Post
ReKlipz
ReKlipz
OK, i've got a question about the MD5Anim format... I can load MD5Meshes and render them fine, but when i tried to load Anims, i got totally confuzzled, heres my question I am trying to render the baseFrame as though it was a static pose, just so that i can see how the algorithm works, but there enlies the problem, i could not find any documentation on the algorithm to find the current position and current rotation quaternion(or matrix, I convert anyways) of the joints one thing i was able to do was just load the positions and then if the joint had a parent, add its parents pos to its pos and then render, here is what i got: [img=http://img323.imageshack.us/img323/3305/one0cu.th.png] and im pretty sure that fatty isnt supposed to look like that... but anyways, if someone could provide me with the algorithm to convert the md5Anim baseframe to basically the same as an md5Mesh joint listing(i intend to make each frame basically a md5mesh, at least store each frames joints in the same way i do the mesh, and then just change which joint set i use to render), i would GREATLY appreciate it I've scoured all over doom3 world.org and could only find info about the file structure, and nothing else had actual algorithms... thanks a BUNCH !ReKlipz
Name_Unknown
Name_Unknown
The animations use some kooky bit flags to tell you what is loaded.
I don't remember the bits at this moment, but if the bit is not present you use the base animation, otherwise you use the changed keyframe in the animation.
Than when you are done take the inverse(world) and use that when animating to put the bind pose back.

All rotations are quats and translations are vectors. Keep them as quats.
Lerp or Slerp them. Build a matrix with translation from it or you can do the translation directly in quats and add the translation.

animation = parent*local

inverse(joint)*animation

"It's such a useful tool for living in the city!"
ReKlipz
ReKlipz
ya, i get the fact that they use a bit flag to tell which things change, but what i dont get is the way you calc the current position in the baseframe, like they are relative i read somewhere

so i would do thisjoint.pos = thisjoint.pos+thisjointsparent.pos;

and that would give me a pic of fatty on his back with his feet bent up to his head

i just dont know how to do the actuall additions of the parents and what not, i dont know where/when to apply the quats to the pos's..., but i do know that for each frame, if there is a change i need to use it, and then find the pos's.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.