mat_multiply(float* matrix1,float* matrix2)

Multiplies matrix1 by matrix2, and copies the result to matrix1.


matrix1 - target matrix
matrix2 - source matrix




Multiplying two transformation matrices results in a matrix that concatenates both transformations.


Row vectors for matrix1
M1 := |m11 m12 m13 m14|
M2 := |m21 m22 m23 m24|
M3 := |m31 m32 m33 m34|
M4 := |m41 m42 m43 m44|

Column vectors for matrix2
N1 := |n11 n21 n31 n41)
N2 := |n12 n22 n32 n42)
N3 := |n13 n23 n33 n43)
N4 := |n14 n24 n34 n44)

The result is a matrix of dot products:
| m11 m12 m13 m14 |   | n11 n12 n13 n14 |   | M1*N1 M1*N2 M1*N3 M1*N4 |
| m21 m22 m23 m24 | * | n21 n22 n23 n24 | = | M2*N1 M2*N2 M2*N3 M2*N4 | | m31 m32 m33 m34 | | n31 n32 n33 n34 | | M3*N1 M3*N2 M3*N3 M3*N4 | | m41 m42 m43 m44 | | n44 n42 n43 n44 | | M4*N1 M4*N2 M4*N3 M4*N4 |


mat_multiply(my_matrix, mat_proj);

See also:

matrix, predefined matrices , mat_identity, mat_scale, mat_set, mat_inverse, mat_transpose, mat_multiply ► latest version online