为什么沿三轴旋转不同于分别旋转每个轴?(Why rotation along three axis is different than rotation each axis separately?)

编程入门 行业动态 更新时间:2024-10-22 23:13:19
为什么沿三轴旋转不同于分别旋转每个轴?(Why rotation along three axis is different than rotation each axis separately?)

所以我定义了这个Box,其大小为(1,2,3),我沿着所有三个轴旋转45°:

Transform { rotation 1 1 1 0.7854 children [ Shape { appearance Appearance { material Material {} } geometry Box { size 1 2 3 } } ] }

但是,当我分别沿每个轴应用相同的旋转时,我得到另一个结果:

Transform { rotation 0 0 1 0.7854 children [ Transform { rotation 0 1 0 0.7854 children [ Transform { rotation 1 0 0 0.7854 children [ Shape { appearance Appearance { material Material {} } geometry Box { size 1 2 3 } } ] } ] } ] }

维基百科告诉我,我可以像这样乘以所有旋转矩阵:R = R(x)R(y)R(z)?

这是上面代码的结果:

So I have this Box defined, which has a size of (1, 2, 3) which I rotate along all three axes with 45°:

Transform { rotation 1 1 1 0.7854 children [ Shape { appearance Appearance { material Material {} } geometry Box { size 1 2 3 } } ] }

But when I apply the same rotation along each axis separately I get another result:

Transform { rotation 0 0 1 0.7854 children [ Transform { rotation 0 1 0 0.7854 children [ Transform { rotation 1 0 0 0.7854 children [ Shape { appearance Appearance { material Material {} } geometry Box { size 1 2 3 } } ] } ] } ] }

Wikipedia tells me I can multiply all rotation matrices like this: R = R(x)R(y)R(z)?

This is the result of the code above:

最满意答案

您描述的第一个旋转不是围绕三个轴的旋转,而是围绕轴(1,1,1)的旋转,这是不同的。 然后通常你没有得到预期的结果。 如果您希望可以根据维基百科的公式计算轴(1,1,1)和角度45的旋转矩阵,并将其与每个轴x,y,z和角度45的旋转矩阵的乘法进行比较会看到你得到不同的矩阵。

The first rotation you describe is not a rotation around the three axis but a rotation around the axis (1,1,1) which is different. It's then normal you don't get the expected result. If you wish you can compute the rotation matrix for the axis (1,1,1) and angle 45 from the formula of Wikipedia and compare it to the multiplication of the rotation matrix for each axis x,y,z and angle 45 and you will see that you get different matrices.

更多推荐

本文发布于:2023-08-01 01:47:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1351402.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:不同于   沿三轴   rotation   separately   axis

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!