|
I have an quaternion-based animation system, and when I export to FBX, I’m getting Euler curves that flip back and forth
around the +- 180 degree mark.
Searching for this problem on Google brings up this page:
http://www.okino.com/conv/exp_fbx.htm
The section under “Maintain Euler Continuity” describes this problem in detail.
Can anyone suggest a coding example that fixes this problem, or provide a FBX SDK solution for it?
All of my attempts to fix it have failed miserably so far.
Also, is there a mathematical name for this condition? Is it related to gimbal lock? Because I tried re-ordering
the Euler rotation order, but I don’t see how that is going to help me if the FBX format only recognizes XYZ-ordered rotations.
Here’s a graph of one such curve. RGB is XYZ euler angles, respectively, from -180 to 180. Y is fine, but
X and Z have problems at +- 180 degrees.

BTW, I’m using the FBX SDK to convert my quaternions to Euler angles, which works fine:
KFbxQuaternion q( quat.x, quat.y, quat.z, quat.w )
KFbxXMatrix M; M.SetQ(q)
KFbxVector4 euler = M.GetR() // in degrees
My animation data is perfectly valid. I just need to know how to fix them when they cross the +-180 border.
Everybody must encounter this problem, because the FBX format only accepts Euler angles.
I can only think of all the game engines that adopt this format, only to discover later on that it will
cripple their animation.
| Attachment
|
|
|