Implementing a Camera with a Matrix.

I’ve been doing some study and have realised that the best we to represent my camera and object’s movements is with matricies.
The problems I’ve having understanding how I’ll do this are:

  1. What do I populate the matrix with? OPGL is column major so what goes in the three columns? Direction, Position and roll?

  2. When I want to modify the coordinate system(camera) do I just do this?
    gluPerspective(m_FieldOfView,(GLfloat)Video.GetWidth()/(GLfloat)Video.GetHeight(), m_ClosePlane, m_FarPlane);

…actually doesn’t the forth row represent the perspective component. Should I be taking advantage of that and dropping that glu command. How do I calculate the perspective component?

I’ve spend a while on google before posting this, there are plenty of camera tutorial around but have use quats, the rest use 3 vectors + gltransform\glRotate.

Many thanks


You should load camera matrix(ViewMatrix) in modelview matrix,not in projection.

Check out the beginer board for a VERY long thread (80-90 replies) for some help in this. I am sure you will find what you need in it. Do a search for multmatrix and you’ll hit it.