请问这个原因万向锁? [英] Will this cause gimbal-lock?

查看:258
本文介绍了请问这个原因万向锁?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我做一个很简单的3D场景,有5个点的世界坐标。我想划过的痕迹导航,所以我定义一个摄像头,同时具有向上和向外载体。有了这个信息我产生在每帧中,我将应用到载体中,以获得在相机坐标旋转矩​​阵

I making a very simple 3d scene, having 5 points in world coordinates. I'd like to navigate across the scene so I'm defining a camera with both an UP and OUT vector. With this information I generate a rotation matrix in every frame, which I'll apply to the vectors in order to get the camera coordinates.

现在的问题是:我读过有关万向节锁定为使用这种方法的问题,但它会发生在这种情况下,

The question is: I've read about gimbal lock as a problem using this method, but would it happen in this case?

请注意,我产生在每帧中的旋转矩阵,而且我不旋转累计。因此,可以锁定发生这种情况呢?如果是这样的话,你会建议安全应用旋转(从向上拉出载体)?

Note that I'm generating the rotation matrix in every frame, and I'm not rotating accumulatively. So could a lock happen in this situation? If that was the case, what would you suggest to safely apply a rotation (from the UP and OUT vectors)?

感谢您

推荐答案

如果通过OUT你的意思是前进,这始终是垂直向上向量,则没有,你不会遇到万向节锁定。

If by OUT you mean "forward", and this is always perpendicular to the UP vector, then NO, you won't encounter gimbal lock.

你正在做什么是创建从向上和FORWARD矢量的取向矩阵,并将该各帧,它是用于移动摄像机在空间中一个相当普遍的方法。 你不是在申请多次旋转使用欧拉角,它可以是万向节锁定的原因。

What you are doing is creating an orientation matrix from the UP and FORWARD vectors, and applying that each frame, which is a fairly common method for moving a camera in space. You are not applying multiple rotations using euler angles, which can be a cause of gimbal lock.

请注意创建你还需要创建一个左的矩阵(或右)向上和向前载体载体。一个很好的介绍,这是在这里 - 请注意,例如是否再申请转来相机矩阵,这是一个完全可选的步骤

Note to create the matrix you will also need to create a "left" (or right) vector from the UP and FORWARD vectors. A good introduction to this is here - note that that example does then apply rotations to the camera matrix, which is an entirely optional step.

维基百科的万向节锁定一个很好的解释。

Wikipedia has a good explanation of gimbal lock.

这篇关于请问这个原因万向锁?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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