Jump to content
  • Advertisement
Sign in to follow this  
ReKlipz

MD5Anim question

This topic is 4851 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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

Share this post


Link to post
Share on other sites
Advertisement
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

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!