[−][src]Module hektor::mat4
Module for 4x4 Matrices.
A 4x4 matrix is needed for certain transformations on 3D vectors:
- The 3D vector is promoted to a 4D vector (generally with a
w
component of 1.0) - The 4D vector is multiplied on the right by the 4x4 matrix.
- The resulting 4D vector is turned back into a 3D vector by dividing
x
,y
, andz
by thew
component (which is why 1.0 is considered the default).
Because we usually care quite a bit about our ability to manipulate 3D
vectors/points, the Mat4
type is used much more than any other matrix.
Structs
Mat4 | A 4x4 Matrix. |