Inside Sabertooth
Learn how Sabertooth uses 3ds Max to create 3D interactive projects, including HBO Go’s Game of Thrones interactive experience
  • 1/3
You are here: Forum Home / Autodesk® FBX® / FBX SDK / Rotation representation conversion
  RSS 2.0 ATOM  

Rotation representation conversion
Rate this thread
 
48459
 
Permlink of this thread  
avatar
  • BE
  • Posted: 17 October 2010 03:26 PM
  • Total Posts: 17
  • Joined: 15 April 2009 08:56 AM

Im i missing something or does the sdk not expose any functionality to convert between different rotation representations? 3x3 -> Quat -> Euler (at specific order) and so forth?



Replies: 1
/userdata/avatar/vx3501hqr_small.jpg

KFbxXMatrix should be the one you need, but it can only handle XYZ rotation order in case of Euler.
Euler->RotationMatrix: KFbxXMatrix::SetR
RotationMatrix->Quat: KFbxXMatrix::GetQ
RotationMatrix->Euler: KFbxXMatrix::GetR

Author: Jiayang Xu

Replied: 17 October 2010 04:52 PM  
avatar
  • BE
  • Posted: 18 October 2010 10:33 AM

Mmm...yes i see that one however since my object very likely has a different order then there is little point using the KFbxXMatrix to extract the rotation.

Seems that there _should_ be a way to set the local matrix to an object rather then having to revert to angles. Or that there would at least be a functionality exposed in the sdk that does the euler conversion from a 3x3...at the very least from quaternions as it seems to be happening all the time under the hood anyway when curves are evaluated by KFbxAnimEvaluator or not?

Just seems that it would have been obvious to expose it rather then having everyone use their own implementation for that very common task.

...i guess not :)



Replies: 1
/userdata/avatar/vx3501hqr_small.jpg

Thanks for your report! And we did get similar request before so it is planned to improve KFbxXMatrix to take care of any rotation order, just for now I cannot give a specific release time about that.

For the suggestion about to set the whole transform matrix to an object rather than having to revert to angles, here is the answer from our FAQ:
2.13 How can I directly set the global transformation matrix of a node?
This is not supported in the current FBX SDK and it is not planned to support it in future versions.

And here is some comments from our Development Lead:
The node shall not have two different transform at any time, and the FBX SDK is not an API to handle rendering like OpenGL or DirectX were each node only has a global matrix that doesn’t handle rotation offsets, pivots, etc.
The FBX SDK is not an editing system. It is an interoperability and evaluation system. That means we provide every components to describe and animation (Local Matrix + Rotation Offsets + Pivots + Etc. for transport purposes) to calculate the global transform (for evaluation purposes) and not the inverse.

Author: Jiayang Xu

Replied: 18 October 2010 07:38 PM  
avatar
  • BE
  • Posted: 19 October 2010 09:57 AM

Good on updating the KFbxXMatrix class, really the main issue I see is acquiring angles in xyz order only. I don’t think its right that one should need to bring in further dependencies to just do the euler conversion. Would probably also help cut down on the queries regarding how to do that as most documentation on the topic is very vague or does not cover all cases.

A correction though. I did not state that one should be able to set the global matrix of an object, but rather then having to worry about euler order conversions it would helpful to be able to apply a local matrix (pivots and pre transforms baked in). Or extend the KFbxAnimEvaluator so that given an object and a local matrix it can decompose it into data that fits the curves based on the object in question.

I do still think that if there are methods that allow me to acquire a matrix from a node then there should be a method to allows me to apply the same matrix to the same node...but fair enough, its the evaluator that provides the methods which is rather different then if KFbxNode did have such a method so as long as its easy enough to extract the angles at the order that the node requires to accept the data that was extract then ill shut up about it :)



Replies: 1
/userdata/avatar/vx3501hqr_small.jpg

Thanks a lot for the clarification! You added one more cent to urge the team to improve the euler conversion for different rotation orders.

Author: Jiayang Xu

Replied: 19 October 2010 03:39 PM