PDA

View Full Version : Calculating matricies



Kirill
01-24-2001, 12:35 AM
How can I calculate my own viewing matrix?
The question is: the matrix stores rotation, translation, scale, ... . But the transforms are not commutative - that is, the result is not the same from rotate then translate or on the contrary. That is, if i simply fill the 4*4 matrix with rot. & trans. - result - will be wrong. Is there a symply way to imagine what the entire matrix, but not any part of it will do?

Michael Steinberg
01-24-2001, 06:13 AM
You can think of your end-transform matrix as a connection of several transformations like rotation, scaling and translation. They are combined via a matrix multiplication.

If you want to do this

1. Rotate
2. Scale
3. Translate

You'll have to multiply the matrix in this conter-order:

1. Multiply Translation with Scale
2. Multiply result with Rotation

If you want you tranform to be apllied to a camera view, you'll have to use the transpose of the transform matrix of the camera.

There's quite an interresting discussion about that stuff on this board. Topic is glMultMatrix if I remember correctly.