在 3D 中组合多个旋转矩阵 [英] Combine multiple rotation matrixes in 3D

查看:29
本文介绍了在 3D 中组合多个旋转矩阵的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经计算了每个轴的轴角旋转.如果我只应用三种旋转中的一种,则对象会按预期旋转.

I have calculated an axis angle rotations for each axis. If I only apply one of the three rotations, the objects rotates as expected.

如果我将旋转矩阵相乘,就像您通常在组合旋转时所做的那样,我不会得到想要的结果,因为第一次旋转会影响其他旋转,因此最终结果不是我想要的.

If I multiply the rotation matrixes, as you would normally do it if you combine rotations I don't get the desired result, cause the first rotation affects the others and therefore the end result is not what I'm looking for.

我想将每个旋转应用到对象上,就好像它以前没有旋转过一样.

I want to apply each rotation to the object as if it wasn't rotated before.

我想这是一项简单的任务,但似乎我没有搜索正确的关键字.(还有标题不完美...(开放征求意见))

I guess this is a simple task, but it seems that I'm not searching for the right keywords. (Also the title is not perfect ... (open for suggestions))

感谢每一个提示/帮助.

Thanks for every hint / help.

推荐答案

您遇到了万向节锁.这不是数学问题,而是逻辑谬误.为便于描述,请尝试使用您的手机:

You're experiencing gimbal lock. It's not a maths problem, it's a logical fallacy. Try it with, for the sake of description, your phone:

  1. 将其正面朝上放在您的办公桌上,充电接口在底部.
  2. 围绕 z 顺时针旋转 90 度.所以充电接口现在在左边.
  3. 围绕 x(假设充电端口位于顶部或底部,这将是手机的较长轴)旋转 180 度.
  4. 手机现在颠倒了,充电端口在左边.

但是:

  1. 将其正面朝上放在您的办公桌上,充电接口在底部.
  2. 围绕 x 旋转 180 度.所以充电接口现在位于顶部.
  3. 围绕 z 顺时针旋转 90 度.
  4. 手机现在颠倒了,充电端口在右侧.

如果指令是围绕 x 旋转 180 度和围绕 z 顺时针旋转 90 度,那么哪个是不正确的?两者都不正确.说明含糊不清.

Which of those is incorrect if the instruction was to rotate 180 degrees around x and 90 degrees clockwise around z? Neither is incorrect. The instructions were ambiguous.

个人旋转的顺序总是很重要,因为第二个影响第一个完成的工作,第三个影响第一个和第二个完成的工作,依此类推.改变顺序只会改变影响哪个.

The order of individual rotations always matters, because the second affects the work done in the first, the third affects the work done in the first and second, etc. Shuffling the order just changes which affects which.

方向通常直接存储为矩阵或四元数,因为它是明确的,并且因为它保持了正确排序的动作顺序.

Orientation is normally stored directly as a matrix or as a quaternion because it's unambiguous and because it keeps the order of actions properly ordered.

这篇关于在 3D 中组合多个旋转矩阵的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆