Problem with displaying a hierarchical pose with rotation keys from ASE files
category: general [glöplog]
hello everyone,
i'm new here and i thought i could ask for some help with a 3d engine problem i've been having.
i am using an ASE file loader to read stuff exported from 3ds max. everything works fine so far, except rendeing animation with rotations. i have a set of 2 bones to test with, the child linked to the parent and what happens is when i read the rotation keys the child rotates on a different axis. if i have both bones unlinked, their individual rotations work ok. when i link them, the parent rotates ok again, but the child rotates through the wrong axis.
i have been told that i need to multiply the matrix of the child by the inverse of the parent's TM, which is loaded for each node. the problem is that i have never needed the TM or the decomposed values from it to have the bones appear ok on screen. i have also been told that i need to multiply each vertex by the node's TM while loading for it to appear ok on screen, but i never needed it, and if i do that, the bones are positioned and rotated in the wrong way.
when unlinked, the second bone has rotation keys:
*CONTROL_ROT_TCB {
*CONTROL_TCB_ROT_KEY 0 -0.7055 0.0669 0.7055 3.0080 0.0000 0.0000 0.0000 0.0000 0.0000
*CONTROL_TCB_ROT_KEY 4320 -1.0000 -0.0000 -0.0000 0.4365 0.0000 0.0000 0.0000 0.0000 0.0000
*CONTROL_TCB_ROT_KEY 11360 1.0000 0.0000 0.0000 0.8235 0.0000 0.0000 0.0000 0.0000 0.0000
but when second bone is linked as a child to first bone, second bone's rotation keys are:
*CONTROL_ROT_TCB {
*CONTROL_TCB_ROT_KEY 0 -0.0000 -0.0000 1.0000 0.3686 0.0000 0.0000 0.0000 0.0000 0.0000
*CONTROL_TCB_ROT_KEY 4320 0.0000 -0.0000 1.0000 0.4365 0.0000 0.0000 0.0000 0.0000 0.0000
*CONTROL_TCB_ROT_KEY 11360 -0.0000 0.0000 -1.0000 0.8235 0.0000 0.0000 0.0000 0.0000 0.0000
this makes the child bone rotate in the wrong axis...
this happens when there is a linked set of objects, i am testing with only two bones, parent and child...
anyone can help me?
thank you very much
i'm new here and i thought i could ask for some help with a 3d engine problem i've been having.
i am using an ASE file loader to read stuff exported from 3ds max. everything works fine so far, except rendeing animation with rotations. i have a set of 2 bones to test with, the child linked to the parent and what happens is when i read the rotation keys the child rotates on a different axis. if i have both bones unlinked, their individual rotations work ok. when i link them, the parent rotates ok again, but the child rotates through the wrong axis.
i have been told that i need to multiply the matrix of the child by the inverse of the parent's TM, which is loaded for each node. the problem is that i have never needed the TM or the decomposed values from it to have the bones appear ok on screen. i have also been told that i need to multiply each vertex by the node's TM while loading for it to appear ok on screen, but i never needed it, and if i do that, the bones are positioned and rotated in the wrong way.
when unlinked, the second bone has rotation keys:
*CONTROL_ROT_TCB {
*CONTROL_TCB_ROT_KEY 0 -0.7055 0.0669 0.7055 3.0080 0.0000 0.0000 0.0000 0.0000 0.0000
*CONTROL_TCB_ROT_KEY 4320 -1.0000 -0.0000 -0.0000 0.4365 0.0000 0.0000 0.0000 0.0000 0.0000
*CONTROL_TCB_ROT_KEY 11360 1.0000 0.0000 0.0000 0.8235 0.0000 0.0000 0.0000 0.0000 0.0000
but when second bone is linked as a child to first bone, second bone's rotation keys are:
*CONTROL_ROT_TCB {
*CONTROL_TCB_ROT_KEY 0 -0.0000 -0.0000 1.0000 0.3686 0.0000 0.0000 0.0000 0.0000 0.0000
*CONTROL_TCB_ROT_KEY 4320 0.0000 -0.0000 1.0000 0.4365 0.0000 0.0000 0.0000 0.0000 0.0000
*CONTROL_TCB_ROT_KEY 11360 -0.0000 0.0000 -1.0000 0.8235 0.0000 0.0000 0.0000 0.0000 0.0000
this makes the child bone rotate in the wrong axis...
this happens when there is a linked set of objects, i am testing with only two bones, parent and child...
anyone can help me?
thank you very much
one thing you have to consider that .ASE is always in XZY order, even with quaternions
