在旋转矩阵之间进行插值 [英] Interpolating between rotation matrices

查看:371
本文介绍了在旋转矩阵之间进行插值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有2个旋转矩阵(分别称为A和B),其中:

I have 2 rotation matrices (lets call them A and B) where:

A = 1  0  0
    0  0 -1
    0  1  0

B = -1  0  0
     0  0 -1
     0 -1  0

这基本上只是旋转,相机旋转以向后看. 显然,我不能直接对矩阵中的值进行插值,因为它看起来很奇怪. 我尝试将矩阵转换为产生2组X,Y,Z角的Euler角,并尝试根据X,Y,Z角的每个分量之间的最小距离来确定要使用的角.那肯定会导致我想要的旋转,但是我想不出一种确定在哪个角度进行插补的好方法,因为有时导致误差最小的角度组会导致围绕错误的轴/轴的旋转. 我也尝试过四元数,但是从本质上讲,它给了我相同的结果.谁能指出我正确的方向?

This is basically just a rotation where the camera spins around to look behind itself. Obviously I can't just interpolate the values in the matrices directly because it looks weird. I have tried converting the matrices to Euler angles which yields 2 sets of X,Y,Z angles and trying to determine which angles to use based on the minimum distance between each component of the X,Y,Z angle. That definitely results in the kind of rotation I want but I can't think of a decent way to determine which angles to interpolate between because sometimes the sets of angles which result in the least error result in a rotation about the wrong axis/axes. I also tried quaternions but that essentially gave me the same result. Can anyone point me in the right direction?

推荐答案

使用四元数(SLERP).旋转矩阵和欧拉角都不适合插值.

Use quaternions (SLERP). Neither rotation matrices nor Euler angles are appropriate for interpolation.

请参见45:05 此处(David Sachs,Google Tech Talk).

这篇关于在旋转矩阵之间进行插值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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