Jump to content
  • Advertisement
Sign in to follow this  
mathematical

General questions about matrix multiplications

This topic is 1209 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I've been trying to really further my understanding of matrices both as a mathematical concept and how they relate to games. After printing out a bunch of worksheets and doing a lot of math, asking a few questions on various forums and doing some google searches to try to confirm that i've done things correctly i've made some general observations that i think are all true.

 

I'm interested to know if any of the observations i've made are incorrect, and if so what would be correct instead. Everything listed below assumes 4x4 square matrices, 1x4 or 4x1 vectors. Translation for row major matrices is assumed to be in the last row, translation for column major matrices is assumed to be in the last column.

 

General observations about matrix multiplications

  • A row vector will always be pre multiplied with a matrix (not possible to post multiply)
  • A column vector will always be post multiplied with a matrix (not possible to pre multiply)
  • When multiplying row major matrices, the inner dimensions of the matrices must match
  • When multiplying row major matrices, the outer dimensions of the matrices are the same as the dimensions of the result
  • When multiplying column major matrices, the outer dimensions of the matrices must match
  • When multiplying column major matrices, the inner dimensions of the matrices are the same as the dimensions of the result
  • A row vector (pre) multiplied with a row major matrix yields a row vector
  • A row major matrix (post) multiplied with a column vector yields a column vector
  • A row vector (pre) multiplied with a column major matrix yields a column vector
  • A column major matrix (post) multiplied with a column matrix yields a row vector

Assuming we have a row major matrix that represents a translation:

  • Pre multiplying a row vector will result in a row vector that is the matrix translation applied to the original vector
  • Post multiplying a column vector will only yield the vector translated by the matrix if the matrix is first transposed

 Assuming we have a column major matrix that represents a translation:

  • Post multiplying a column vector will yield a row vector that is the original column vector translated by the matrix
  • Pre multiplying a row vector will only yield the same result if the matrix is first transposed. either way it will yield a column vector.

Share this post


Link to post
Share on other sites
Advertisement

Your first two points are correct, but the remaining ones doesn't make any sense. Row/column majorness of a matrix has nothing to do with matrix maths, what you can do with it and what the result of operations are. The majorness affects one and only one thing: how the two-dimensional grid of numbers representing the matrix is mapped to a one-dimensional linear memory storage. You have to store the matrix in some way in one-dimensional memory, and the majorness dictates where the individual matrix elements are stores in memory.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!