How is GLKit's GLKMatrix “Column Major”?

后端 未结 3 583
悲&欢浪女
悲&欢浪女 2021-02-04 06:42

Premise A

When talking about \"Column Major\" matrices in linear memory, columns are specified one after another, such that the first 4 entries in mem

3条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2021-02-04 07:09

    The declaration is a bit confusing, but the matrix is in column major order. The four rows in the struct represent the columns in the matrix, with m0* being column 0 and m3* being column 3. This is easy to verify, just create a translation matrix and check values m30, m31 and m32 for the translation components.

    I am guessing your confusion is coming from the fact that the struct lays out the floats in rows, when they are in fact representing columns.

提交回复
热议问题