前提A
当谈到线性内存中的“列主”矩阵时,列是依次指定的,因此内存中的前4个条目对应于矩阵中的第一列。另一方面,“行主”矩阵被理解为按顺序指定行,因此内存中的前4个条目指定矩阵的第一行。
GLKMatrix4
看起来像这样:
union _GLKMatrix4
{
struct
{
float m00, m01, m02, m03;
float m10, m11, m12, m13;
float m20, m21, m22, m23;
float m30, m31, m32, m33;
};
float m[16];
}
typedef union _GLKMatrix4 GLKMatrix4;
The documentation for the m
member states that it is "A one-dimensional array of the matrix's elements in column-major order." However, according to Premise B, a "row" in a GLKMatrix4 is declared horizontally as a set of 4 floats. For example, [m00, m01, m02, m03]
would be the first "row" and interpreted as mRowCol with m12
representing the entry at row 1, column 2. Looking at how the GLKMatrix struct members are laid out, the first four entries represent the first row of the matrix rather than the first column. Therefore, the conclusion is that m
is not actually Column Major, contradicting the documentation. However, the author notes that they do not necessarily believe this conclusion, and questions whether it makes sense to define a "row" as vertical and a "column" as horizontal.
float m00, m01, m02, m03;
是第一个“列”的声明,尽管它“看起来像”一行。这就是__前提B__失败的地方。 - bobobobo