franck22000 Posted October 24, 2012 Share Posted October 24, 2012 Hello, what is the way to get the correct rotation of an entity only by knowing the entity matrix. What are the correct calculations to extract this ? Note: i would like a solution that does not involve creating a pivot and setting the matrix to the pivot and use the entityrotation() command to get the rotation. Thanks ! Quote You guys are going to be the death of me. Josh Link to comment Share on other sites More sharing options...
Canardia Posted November 24, 2012 Share Posted November 24, 2012 heading = atan(m01/m00) bank = atan(m12/m22) attitude = asin(-m02) 1 Quote ■ Ryzen 9 ■ RX 6800M ■ 16GB ■ XF8 ■ Windows 11 ■ ■ Ultra ■ LE 2.5 ■ 3DWS 5.6 ■ Reaper ■ C/C++ ■ C# ■ Fortran 2008 ■ Story ■ ■ Homepage: https://canardia.com ■ Link to comment Share on other sites More sharing options...
macklebee Posted November 24, 2012 Share Posted November 24, 2012 that's not the full story as it doesn't take into account gimbal lock and the Attitude (Y) is inversed in LE. X = math.atan(mat.jz/mat.kz) * (180/math.pi) Y = math.asin(mat.iz) * (180/math.pi) Z = math.atan(mat.iy/mat.ix) * (180/math.pi) the above essentially only works in LE when: X is between -90 and 90 with very low values for Y&Z Y is between -90 and 90 with very low values for X&Z and Z is between -90 and 90 with very low values for X&Y there is more information about this from the place mika copied this from: http://www.opengl.or...l=1#post1135896 which has a link to here: http://www.euclidean...Euler/index.htm Quote Win7 64bit / Intel i7-2600 CPU @ 3.9 GHz / 16 GB DDR3 / NVIDIA GeForce GTX 590 LE / 3DWS / BMX / Hexagon macklebee's channel Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.