PDA

View Full Version : Matrix Multiplication



03-09-2004, 07:02 PM
Can anyone tell me what is the Matrix Multiplication of the below series call of function?

LoadIdentity();
glTranslatef(Tx, Ty, Tz);
glRotatef(degree, 0, 0 , 1);

Thanks....

dovkruger
03-09-2004, 07:27 PM
You should try a glGetFloatV( ... )
and get the matrix so you can look at it yourself.


1 0 0 -Tx
0 1 0 -Ty
0 0 1 -Tz
0 0 0 1

and then the rotation is cosines and sines of x and y:

cos(d) -sin(d) 0 0
sin(d) cos(d) 0 0
0 0 1 0
0 0 0 1

Multiply the two together for the result.