PDA

View Full Version : matrices



omikron
10-17-2002, 08:12 PM
how do i do camera rotation with matrices

mikael_aronsson
10-17-2002, 10:04 PM
Hi !

There are lots of ways to do it, I think the best thing is to look up a matrix tutorial at google and have a look at it.

Normally you have a matrix that holds the rotation and multiply it with an existing matrix of someform (the modelview matrix for example) and the resulting matrix then contains the modelview matrix with the added rotation.

But it's a bit more complicated then that, some times you ned inverse matrices to get the correct result and so on...

It would be a bit easier if you would explain what it is you are trying to do.

Mikael

omikron
10-18-2002, 11:03 AM
i am trying to make a set of functions to handle camera movement in opengl.

camrotx()
camroty()
camrotz()

and another to move the camera according to its direction

ARES
10-18-2002, 11:19 AM
http://home.wanadoo.nl/fam.dubbelboer/files/matrix.zip

This is my matrix and vector class.
You can look at it and play with it to find out how marices work.
The zip file also contains a FAQ about matrices.