why does pyrr.Matrix44 translation appear to be column-major, and rotation row-major?

358 views Asked by At

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?

0

There are 0 answers