Sharing Transformations

Started by
4 comments, last by rahulpawar 12 years, 10 months ago
hello everyone!,
well i m unable to decided proper way to handle this may be you guyz could help me out. here is the prob,

i have two skeletons say Arm 1 and Arm 2 as seen in fig.

Arms.jpg

Now i have saved a transformation for Arm1 skeleton [i.e. an animation sequence for Arm1]
( transformation means a matrix or a set[ rotation , scale, translation] )

now from the fig it is clear that the original size of the bones are different in both cases,
so if we directly use the transformations of Arm1 to Arm2 we would get large displacements(linear & angular) and change of bone lengths also
which is totally unacceptable since these bones are skinned and hence these weird side effects will affect the mesh's look

[i know only rotation transformation may not create such effects but when transformation contains rotation along with scale and/or translation it generates those results ]

..... i checked this in 3D Max .
So now, how should i map the transformation from Arm1 to Arm2 without getting those weird side effects....
...
An Answer comes to my mind Relative Transformation Mapping[RTM]
...
In layman's term i need a system that can take
1] given set of transformation
2] other bone system.....Same No Of Bones.....<Should this be required ?>

and outputs new transformation without those weird side effects.

Its like Suppose there are Time Lines AB and CD
Arms2.jpg

Now if Apply transformation from CD to AB using RTM it will be simple linear interpolation between
endpoints A and B based on a delta retrieved from transformation on CD.

But the problem in our case is different because we don't know the end points of the transformation
in Arm2[initial transformation i.e current base pose is only known]

Hence we cant use simple linear or spherical interpolation.

.... Can u Guyz Suggest to make this RTM System work ?
Advertisement
Guys i digged more of google sack and found out something called
"Transformation Matrix with Respect to a Basis"
it the most parallel thing i found along the lines of what i want....Check This and This

But again i do't know the endpoints.....So how can i find the B....

Can some one unwind this !
Guys i digged more of google sack and found out something called
"Transformation Matrix with Respect to a Basis"
it is the most parallel thing i found along the lines of what i want....Check This and This

But again i do't know the endpoints.....So how can i find the B and B[sup]-1[/sup]....

Can some one unwind this !
Guys i digged more of google sack and found out something called
"Transformation Matrix with Respect to a Basis"
it is the most parallel thing i found along the lines of what i want....Check This Video

So now my question is how to find C<change in basis matrix> from Arm1[standard basis] -> Arm2[non standard matrix]...

A hunch tells me that the offset transformation matrix from bone transformation matrix may come in picture

Can some one unwind this !
Guys i digged more of google sack and found out something called
"Transformation Matrix with Respect to a Basis"
it is the most parallel thing i found along the lines of what i want....Check This Video

So now my question is how to find C<change in basis matrix> from Arm1[standard basis] -> Arm2[non standard matrix]...

A hunch tells me that the offset transformation matrix from bone transformation matrix may come in picture

Can some one unwind this !
Why isn't it sufficient to just scale the skeleton? (I mean. for each bone matrix in model space apply the same scaling to each matrix as last step.) Or are the bones scaled independently to yield in the other skeleton?
what i'm trying to implement here is a way in which

suppose you have saved a animation sequence applied to one skeleton hierarchy

You Could Using RTM System Directly use same animation sequence with other skeleton hierarchy
[where character's height body dimensions are different than the earlier one]

.
.
.
OK i did some more digging i found This Video At some point he derives:

C[a][sub]b[/sub] = [a]

where C : change in basis matrix

And We need to find this

so C[a][sub]b[/sub][a][sub]b[/sub][sup]-1[/sup] = [a][a][sub]b[/sub][sup]-1

[/sup]therefore, C = [a][a][sub]b[/sub][sup]-1[/sup] [ Since [a][sub]b[/sub][a][sub]b[/sub][sup]-1[/sup] is Identity Matrix ]


So from my example Can [a] be initial pose matrix of Arm1 and [a][sub]b[/sub] be initial pose matrix of Arm2 so [a][sub]b[/sub][sup]-1[/sup] will be Its inverse......OR

As i guessed earlier offset transformation matrix should be used some how..........

Guz please brainstorm here plz...
It depends how similar are your skeletons. You said, that they have the same number and topology of bones, but do they have the same bone local rotations (for the identical poses) - i.e. are simply differently scaled variants of each other. And whether you need things like expanding libs (hopefully not).
If the local transforms are the same between skeletons, simply break your animation matrices into rotation and translation parts and only apply rotations to other skeleton.
Say you have the transformation of animated bone in skeleton 1 relative to parent bone AB2P1 (AnimatedBoneToParent), then:

(1) AB2P1 = B2P1 * AB2B1


Where B2P1 (BoneToParent) is the local transformation of bone in rest pose (T-pose) and AB2B1 (AnimatedBoneToBone) is relative animation of the bone (compared to the rest pose).
AB2B1 should be pure rotation matrix (unless stretching or scaling of body parts is involved). So for the other skeleton:

(2) AB2P2 = B2P2 * AB2B1

But as I said, this only works, if you have skeletons, that have similar local bone transformations (for same poses). If the bone transformations are different, then you have to go through object/mesh space.

(3) AM2M1 = AP2M1 * B2P * AB2B1 * M2B1
AM2M1 (AnimatedMeshToMesh)
AP2M1 (AnimatedParentToMesh)
M2B1 (MeshToBone)

For each bone AM2M can be broken to translation and rotation parts (AM2M1_t and AM2M1_r), thus:
(4) AM2M1 = AM2M1_t * AM2M1_r
And:
(5) AM2M1_t = translation of AP2M1 * B2P1

The rotation parts of animations of both skeletons should be identical in mesh space, thus:

(6) AM2M2 = AM2M2_t * AM2M1_r

From those formulas you should be able to compose the needed transformations of the other skeleton. There will be lots of matrix calculations initially, but fortunately much of these can be precalculated or optimized out later.
Lauris Kaplinski

First technology demo of my game Shinya is out: http://lauris.kaplinski.com/shinya
Khayyam 3D - a freeware poser and scene builder application: http://khayyam.kaplinski.com/

It depends how similar are your skeletons. You said, that they have the same number and topology of bones, but do they have the same bone local rotations (for the identical poses) - i.e. are simply differently scaled variants of each other. And whether you need things like expanding libs (hopefully not).
If the local transforms are the same between skeletons, simply break your animation matrices into rotation and translation parts and only apply rotations to other skeleton.
Say you have the transformation of animated bone in skeleton 1 relative to parent bone AB2P1 (AnimatedBoneToParent), then:

(1) AB2P1 = B2P1 * AB2B1


Where B2P1 (BoneToParent) is the local transformation of bone in rest pose (T-pose) and AB2B1 (AnimatedBoneToBone) is relative animation of the bone (compared to the rest pose).
AB2B1 should be pure rotation matrix (unless stretching or scaling of body parts is involved). So for the other skeleton:

(2) AB2P2 = B2P2 * AB2B1

But as I said, this only works, if you have skeletons, that have similar local bone transformations (for same poses). If the bone transformations are different, then you have to go through object/mesh space.

(3) AM2M1 = AP2M1 * B2P * AB2B1 * M2B1
AM2M1 (AnimatedMeshToMesh)
AP2M1 (AnimatedParentToMesh)
M2B1 (MeshToBone)

For each bone AM2M can be broken to translation and rotation parts (AM2M1_t and AM2M1_r), thus:
(4) AM2M1 = AM2M1_t * AM2M1_r
And:
(5) AM2M1_t = translation of AP2M1 * B2P1

The rotation parts of animations of both skeletons should be identical in mesh space, thus:

(6) AM2M2 = AM2M2_t * AM2M1_r

From those formulas you should be able to compose the needed transformations of the other skeleton. There will be lots of matrix calculations initially, but fortunately much of these can be precalculated or optimized out later.


Well Finally some hope,

Firstly, Thanks Lauris Kaplinski for Replying ....... And Thats indeed what i would have to do..... i also took the liberty to check "Khayyam 3D" project . . .i would go in little depth there later

Secondly, Just to inform that My Prob goes in "bone transformations are different" Case as you said.

Thirdly, when you said "object/mesh space" did you meant using offset bone matrix to go from bonespace1->worldspace->bonespace2...

Its just that i got rest of how i should handle the separated(rotation+translation) transformations But could you shed little bit more light on the "object/mesh space" part.....thanks in advance

This topic is closed to new replies.

Advertisement