问题
consider the following:
>>>Matrix44.from_translation( np.array([1,2,3]))
Matrix44([[1, 0, 0, 0],
[0, 1, 0, 0],
[0, 0, 1, 0],
[1, 2, 3, 1]])
>>> Matrix44.from_x_rotation(0.5 * np.pi)
Matrix44([[ 1.0, 0.0, 0.0, 0.0],
[ 0.0, 0.0, -1.0, 0.0],
[ 0.0, 1.0, 0.0, 0.0],
[ 0.0, 0.0, 0.0, 1.0]])
The translation matrix shows that the layout of the matrix is column-major, but the rotation matrix, confusingly, suggests that it is row-major, if you consider that the standard right-hand 3x3 rotation matrix around X in row-major notation reads:
0.0 0.0 0.0
0.0 cos(a) -sin(a)
0.0 sin(a) cos(a)
As seems to be the result returned by from_x_rotation
.
Does anyone know if this is a bug, or am I misinterpreting something?
来源:https://stackoverflow.com/questions/61061408/why-does-pyrr-matrix44-translation-appear-to-be-column-major-and-rotation-row-m