FbxNode::EvaluateGlobalTransform() returns affine matrix
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Why does FbxNode::EvaluateGlobalTransform() return an affine matrix (FbxAMatrix)? If both the parent and child node contain non-uniform scaling the resulting matrix would not be affine anymore. I made a simple test with two affine matrice containing non-uniform scale and storend the result of the multiplication in FbxMatrix and FbxAMatrix. The decomposition is inconsistent. I would have assumed the the shear is simply ignored, but the it seems that the affine matrix assumes an orthogonal basis (I attach the example at end of this post).
So my question is if under the hood some magic decomposition is happening or if I want to be safe I need to store the result in an FbxMatrix and then use FbxMatrix::GetElements() for the correct decomposition?
The documentation clearly states:
FBX and Maya
The following formula represents how the FBX SDK and Maya compute the transformation matrix for a node:
WorldTransform = ParentWorldTransform * T * Roff * Rp * Rpre * R * Rpost -1 * Rp -1 * Soff * Sp * S * Sp -1
Any given vector is transformed so that V' = WorldTransform * V.
So until I am missing somthing returning an affine matrix doesn't make sense in that context, right?
Thanks,
-Dirk
PS (example):
FbxAMatrix M1;
M1.SetR( FbxVector4( 45, 0, 45 ) );
M1.SetT( FbxVector4( 0, 0, 1 ) );
M1.SetS( FbxVector4( 2, 1, 4 ) );
FbxAMatrix M2;
M2.SetR( FbxVector4( 45, 0, -45 ) );
M2.SetT( FbxVector4( 0, 0, 1 ) );
M2.SetS( FbxVector4( 4, 1, 2 ) );
FbxAMatrix A = M1 * M2;
FbxVector4 AR = A.GetR();
FbxVector4 AT = A.GetT();
FbxVector4 AS = A.GetS();
FbxMatrix M = M1 * M2;
double Det = 0;
FbxVector4 R, T, S, SH;
M.GetElements( T, R, SH, S, Det );
The results for rotation and scale are different!