Search
Primary links
Please donate to libfreevec to ensure its continuing development! Donations are done via Paypal.
Matrix operations
Matrix 4x4 multiplication (floats)
markos — Sat, 01/03/2008 - 20:08
Matrix multiplication is done on a column x row basis. Given two input matrices m2, m3 we do the multiplication and store the result back to an output matrix m1. Hence the function prototype:
void Mat44MulTo(Mat44 m1, Mat44 m2, Mat44 m3);
Matrix 4x4 scaling (floats)
markos — Sat, 01/03/2008 - 19:16
Scaling a matrix implies multiplying each element with a float. Assume the following prototype:
void Mat44ScaleTo(Mat44 m1, Mat44 m2, float f);
where we multiply matrix m2 with the float f and store the result into m1.
Matrix 4x4 addition/subtraction (floats)
markos — Sat, 02/02/2008 - 03:54
Let's assume we want to do addition or substraction of 2 4x4 32-bit float matrices. First step is to load the arrays. We will assume that the arrays are 16-byte aligned (all/most SIMD engines require this) which will also give a nice boost. Let's assume we have the following typedef: