如何转换一个3x3的旋转矩阵为4x4矩阵? [英] How to convert a 3x3 rotation matrix into 4x4 matrix?
问题描述
我目前使用一个3x3的旋转矩阵与3D点工作。
I'm currently using a 3x3 rotation matrix to work with 3D points.
请问这个矩阵从4x4矩阵有什么区别?
How does this matrix differ from a 4x4 Matrix?
和我怎么转换3x3矩阵成一个4x4?
And how do I convert a 3x3 matrix into a 4x4?
推荐答案
一个4x4矩阵可以用来做旋转和平移一个矩阵。
A 4x4 matrix can be used to do both rotation and translation in a single matrix.
在 TX
, TY
值时按下右侧的矩阵将被添加到X,Y, ž你正在改变顶点。
The tx
, ty
values down the right side of your matrix would be added to the x, y, z of the vertex you are transforming.
所以到3x3矩阵转换为四轮驱动,只需在值复制为3×3左上块,像这样:
So to convert a 3x3 matrix to a 4x4, you simply copy in the values for the 3x3 upper left block, like so:
[ a11 a12 a13 ]
[ a21 a22 a23 ]
[ a31 a32 a33 ]
这是3×3成为该4×4
That 3x3 becomes this 4x4
[ a11 a12 a13 0 ]
[ a21 a22 a23 0 ]
[ a31 a32 a33 0 ]
[ 0 0 0 1 ]
请注意,在4×4的左上块得到直复制和0被输入为其他新的,额外的条目(表示我不希望被添加任何译本)。
Notice in the 4x4 the upper left block got straight copied, and 0's were entered for the other new, extra entries (indicating I don't want any translation to be added).
这篇关于如何转换一个3x3的旋转矩阵为4x4矩阵?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!