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

我与影子孤独终老i 提交于 2020-04-30 09:12:29

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!