PDA

View Full Version : Matrix trans & rotations



Bobo.Bobo
05-23-2004, 01:12 AM
Hi,
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.identity();
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.

plasmonster
05-23-2004, 11:07 AM
Cameras can be very confusing if you don't understand the math behind them.

Here's a crash course on matrices
http://skal.planet-d.net/demo/matrixfaq.htm

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
http://fly.cc.fer.hr/~unreal/theredbook/
This covers the gl matrix conventions, and has some camara examples as well.

edit:

If you're in the poor house (like me), there's a free book on linear algebra here
http://joshua.smcvt.edu/linearalgebra/