3 ms·
If we're talking about 3D rendering then a matrix multiplication with a vector are just projections: A 3x3 matrix that transforms a vector is nothing else than
by OneGuy123 6y ago
If we're talking about 3D rendering then a matrix multiplication with a vector are just projections: A 3x3 matrix that transforms a vector is nothing else than that vector being projected onto the 3 axis which are inside the 3x3 matrix. This is very easy to see visually.
A matrix times matrix multiplication (eg 3x3 times 3x3) is just projecting the axis of one matrix onto the other: expressing the coordinate system in terms of a different coordinate system.
The 4x3 (or 4x4) matrix is needed for translation and 3d projection for a 3d triangle onto a 2d plane (screen pixels).
For translation: it's just a hack since if you write it out it's a nice and a fast hack to simulate "movement".
Then for projection you just hack the numbers in the matrix in such a way that you shrink things further apart from the origin.
TLDR: for 3d graphics matrices are used because you can hack them to represent any kind of a transformation.
The reason they are used is because graphics cards are fast at performing dot products. Plus matrix multiplication doesn't require trigonometry or division so it doesn't require the slower transcendental GPU instructions (sin, cos,...).
For other uses their interpretations is different.
I always hated the dull mathematic definition of "a matrix represents a linear map" because what the matrix actually represents is completely context dependent.
- d_tr 6y ago> I always hated the dull mathematic definition of "a matrix represents a linear map" because what the matrix actually represents is completely context dependent. The projection and translation matrices you mentioned represent restricted sets of linear maps in some vector space, but the meaning of the restriction is also captured in other mathematical structures. See affine spaces and projective spaces.
- Koshkin 6y agoSure - remember those noisy dot matrix printers?..
- markisus 6y agoThe projection viewpoint for a rotation matrix using dot products is totally valid, but I think the column viewpoint is more intuitive. A 3x3 matrix can be viewed as something that acts on the standard unit basis vectors. The action on the standard unit basis vectors can be read out by looking at the columns. (A matrix times the ith standard basis vector is just the ith column.) Since the transform is linear, all the other points in space are carried along with the action as well. This is the "linear map" viewpoint of a rotation matrix. I show an example here https://biro.ai/we-learned-the-wrong-way-to-matrix-multiply/ https://biro.ai/we-learned-the-wrong-way-to-matrix-multiply/ where this viewpoint lets you instantly see what a rotation matrix does by looking at the columns.