0

This is how I (possibly mistakenly) understand it. Please correct me if I am wrong.


Assuming a 4x4 matrix composed of vectors v0 through v3 is stored in a one-dimensional array with indices [00] through [15]...

Arranged by vector:

{ v0.x, v0.y, v0.z, v0.w,   // v0
  v1.x, v1.y, v1.z, v1.w,   // v1
  v2.x, v2.y, v2.z, v2.w,   // v2
  v3.x, v3.y, v3.z, v3.w }  // v3
  • Column-major notation index positions:

[00] [04] [08] [12]
[01] [05] [09] [13]
[02] [06] [10] [14]
[03] [07] [11] [15]

  • Row-major notation index positions:

[00] [01] [02] [03]
[04] [05] [06] [07]
[08] [09] [10] [11]
[12] [13] [14] [15]

Arranged by component:

{ v0.x, v1.x, v2.x, v3.x,    // x components
  v0.y, v1.y, v2.y, v3.y,    // y components
  v0.z, v1.z, v2.z, v3.z,    // z components
  v0.w, v1.w, v2.w, v3.w }   // w components
  • Column-major notation index positions:

[00] [01] [02] [03]
[04] [05] [06] [07]
[08] [09] [10] [11]
[12] [13] [14] [15]

  • Row-major notation index positions:

[00] [04] [08] [12]
[01] [05] [09] [13]
[02] [06] [10] [14]
[03] [07] [11] [15]


Is this correct?

  • The Arranged by vector: terminology is ambiguous. 4-space Vectors can be row vectors(4x1) or column vectors(1x4). – agone Oct 19 '23 at 00:10
  • It's not clear to me what you mean with this question. I would understand "row major" and "column major" to refer to the first two layout examples you give. I don't know what you mean by "arranged by vector" vs "arranged by component". If I'm using a column major layout, I expect the members of each column of the matrix to be arranged consecutively in memory. If I'm using a row major layout, I expect the members of each row of the matrix to be arranged consecutively in memory. If you're asking about something else, can you clarify what it is you need help understanding? – DMGregory Oct 23 '23 at 15:27

0 Answers0