Matrix trans & rotations

I have couple implementations of matrix multiplication and I found that there are 2 ways of doing it:
I tried to do something like that:
matrix.translate(1, 2, 3);
matrix.rotate(axis, angle);

and then I have 2 diffrent results. One of them changed the values 1, 2, 3 in ‘translation’ positions ([0,3], [1,3], [2,3]) and the second haven’t. When I changed order of operations in one implementation (first rotation after that translation) the results were the same.
What’s going on? In one implementation I’ve to first rotate then translate and in the second I’ve to translate and after that rotate.

Cameras can be very confusing if you don’t understand the math behind them.

Here’s a crash course on matrices

However, I urge you to get a good book on the subject. Once you have a good grasp of matrices you can browse an innumerable array of threads here related to cameras.

Here’s an online version of the Red Book
This covers the gl matrix conventions, and has some camara examples as well.


If you’re in the poor house (like me), there’s a free book on linear algebra here