Hello Guest

Skeletal Animation - Translation problem

  • 1 Replies
  • 5918 Views
Skeletal Animation - Translation problem
« on: February 24, 2006, 19:55:55 »
I posted a topic earlier about skeletal animation, but have narrowed most of it down to 1 problem - Translations!!

Currently in my code, I can Rotate and Translate joints.  The problem is, when it comes time to "Reset" the animation, the translations totally mess up.

My code works like this:

As a command, either Rotate or Translate happens to a given joint, that joint's orientation matrix(4x4) is multiplied by either a rotation or translation matrix.  At the end of the animation, I run through all the commands in reverse, and apply to the joint the reverse of what it was (so if it was translate (10, 10, 10), when in reverse it'll create a translation matrix (4x4) with the translation portion of  (-10, -10, -10).  This all works fine if all I deal with are rotations.  However, the reverse translations get all wonky.

So, for example, I say Rotate frm 1, Translate in frm 2 (span 2 frames), Rotate in frm 3 to Joint1 -- Now I've multiplied joint1's orientation by the Rotate, Translate, Rotate at the end of the animation and it's in the right spot.  But, when I reverse this, I multiply Rotate, Translate, Rotate (matrices) all together and then apply to the joint, and boom, it's messed up.  

I have a feeling the problem lies in that the translate happened over 2 frames (so it translated for 1 frame with whatever rotation was applied in frame 1, and then in the 3rd frame it kept translating while a rotation command was applied)...

Can anyone give me any help here with translations in skeletal animation, or the "right way" to do things like this?

hmmmmmmm...
« Reply #1 on: February 27, 2006, 17:27:17 »
Code would help (if you don't mind sharing it).
Otherwise, could you be more specific?
Like, what the problem looks like after the reverse matrix is applied (are the joints unconnected or whatever).
Could it be rounding errors which will happen in something like this?
It sounds like you are creating one matrix to do this, is it possible to step through the creation of the matrix and see if or when it goes bad?
Have you tried doing an animation with only one-frame movements to see if it is the multiple frames that are messing up?
You said it works fine with only rotations. Have you tried with only translations?

Just some thoughts... My matrix math is really bad so don't ask me about specifics  :lol:
Programmers will, one day, rule the world... and the world won't notice until its too late.Just testing the marquee option ;D