Itoo Software Forum

Author Topic: Export data - transformation matrix  (Read 854 times)


  • Newbie
  • *
  • Posts: 34
Export data - transformation matrix
« on: February 21, 2019, 07:52:29 PM »

please, how can I convert rotation matrix to numbers in degrees? I tried sin/cos, but I can not obtain same rotation numbers like in transform type-in window(after instantiate FP objects).

If I set in FP rotation only for one axis e.g. X: from 15° to 15°, then I am able to find number 0.258819...(sin 15°) in transform matrix. But After I set rotation in FP for all XYZ axis, then none of the numbers seems to be sin or cos of those angles.

Thanks for help.


  • Administrator
  • Hero Member
  • *****
  • Posts: 3967
    • iToo Software
Re: Export data - transformation matrix
« Reply #1 on: February 22, 2019, 12:01:23 PM »

For C++, i use the "GetYawPitchRoll" function, which is available in the Max SDK.

For Maxscript, i'm not familiar with it, but i think you must extract the rotation part of the matrix with "rotation", which is expressed as a Quaternion, and then "quatToEuler2" to convert to angles.

You can find some theory here:

I don't know what you want to get, but in most of cases it's easier to transform the item directly with the full transformation matrix ("localTM" or "finalTM" in the exporter).

« Last Edit: February 22, 2019, 12:06:14 PM by iToo »
Carlos Quintero
iToo Software


  • Newbie
  • *
  • Posts: 34
Re: Export data - transformation matrix
« Reply #2 on: February 22, 2019, 03:09:14 PM »
OK, thanks, the link to autodesk matrix3 helped me. Now I can export FP items transformation values to unity3d engine with few commands  without instantiating in max ;)
Code: [Select]
$.namelist[$.trees.getGeomID 0]
($.trees.getFullTransform 0).rotationpart as eulerAngles)
($.trees.getFullTransform 0).scalepart
($.trees.getFullTransform 0).translationpart
I am not a big friend with Matrices, so I am happy that easier solution exist  :)