【发布时间】:2020-11-09 10:00:50
【问题描述】:
我有 OpenGL(右手坐标,Y 向上,-Z 向前)4x4 变换矩阵,可以正确旋转偏航,但俯仰和滚动被翻转。位置也是正确的。
有没有办法将围绕 z 轴的旋转翻转为实际围绕 x 轴旋转,反之亦然?
Transformation matrix [
x1 y1 z1 w1
x2 y2 z2 w2
x3 y3 z3 w3
0 0 0 1
]
我试图从矩阵中分解出 T R S 并仅将旋转矩阵与坐标系更改矩阵相乘,但没有成功。例如。我试过了:
Identity matrix with x and z flipped [
0 0 1
0 1 0
1 0 0
]
【问题讨论】:
-
见Is there a way to calculate 3D rotation on X and Y axis from a 4x4 matrix你只需要有2个配置你的源旋转
S顺序和第二个所需的D然后从S转换成一些矩阵M和然后从M到D...
标签: opengl matrix rotation coordinates