Jump to content

Extracting rotation from an entity matrix


franck22000
 Share

Recommended Posts

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 !

You guys are going to be the death of me. Josh
Link to comment
Share on other sites

  • 5 weeks later...

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

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

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...