开发者

How to convert euler xyz to euler zxy using javascript

开发者 https://www.devze.com 2023-03-22 07:26 出处:网络
I am trying to convert euler rotation order from existi开发者_Python百科ng xyz to zxy.Could anyone please help me in doing this?Thanks.

I am trying to convert euler rotation order from existi开发者_Python百科ng xyz to zxy. Could anyone please help me in doing this? Thanks.

Edit: I found this really useful article, thinking it may help others on the same path - http://knol.google.com/k/matrices-for-3d-applications-translation-rotation#Rotation_matrices_for_Euler_angles(C2)(A0)_(28)rotation_round_X(2C)Y_and_Z_axis(29)


See this link: http://en.wikipedia.org/wiki/Euler_angles#Matrix_orientation. Make 9 equations from xyz to zxy matrix and solve them.


In your particular case, there's an easy way to do it. that's because you are changing the x->z, the y->x and z->y, so in a circular way that mantains the right hand order of axis. So if the matrix is:

m[0] m[3] m[6]
m[1] m[4] m[7]
m[2] m[5] m[8]

you have to rotate the columns so the 3rd becomes 1st,

m[6] m[0] m[3]
m[7] m[1] m[4]
m[8] m[2] m[5]

and after exchange the coords in the rows:

m[8] m[2] m[5]
m[6] m[0] m[3]
m[7] m[1] m[4]

so the correspondence is between first and third matrix, for example:

m[0] --> m[8]
m[4] --> m[0]
m[8] --> m[4]

and so on.

substitute the matrix elements in your formulas and that's all, folks!

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号