Raven July 15, 1999, 05:00 PM 

Scott Baillie wrote: >>Thanks. I think i've got the basic camera set up okay. I currently have a camera position and a camera matrix as follows. >> >>Camera pos = (0,0,0)  At the origin for now >> >>Camera Matrix = 1, 0, 0, 0 >> 0, 1, 0, 0 >> 0, 0, 1, 0 >> 0, 0, 0, 1 >> >>Roration matrix  depends which direction I want to rotate. >> >>I now do the following for each vertex coord >> >>New Object Coord = Rotation Matrix * Camera Matrix * (world object position  camera position) >> >>This seems to work when I want to rotate the camera but I can't move the camera forward(in to the screen) or sidetoside. >> >>Any ideas? >> >>Thankz. >> >>
Hello again.
I don't really know what it is that is happening here, but maybe it's what i think it is. You have to remember that matrix multiplication is NOT commutative. what it means is that if we have a matrix Aij and Bkl then Aij*Bkl does NOT equal Bkl*Aij. I found out the hard way:) that in a camera transformation the translation has to go before the rotation. This is due to the fact that unless you will move first you will be rotating about the origin of the world system, not the camera system. You'll get an orbiting effect instead of a moving effect. If you change your coordinates during rotation you'll hardly see any change at all. This is possibly what's happening. As far as i see you are doing everything correct except for the order of your matrix concatenation. Explanation:
Camera matrix=Identity matrix(?)
 1 0 0 0   0 1 0 0  => This is usually called an identity matrix. It's linear transformation that  0 0 1 0  doesn't transform anything  0 0 0 1 
camera pos=(object world coordinatescamera world coordinates)
Multiply this by your translation vector(camera pos). NOTE! the vector has to be in a homogenious 4D space ie (0,0,0,1), since all your matrices are 4dimensional(Don't worry about this)
If camera pos=(x1,y1,z1,w) where x1, y1, z1 are (object worldcoordcamera worldcoord) then your translation matrix will be:
 x1 0 0 0   0 y1 0 0   0 0 z1 0   0 0 0 w 
Now multiply this by your rotation matrix and try moving the camera pos around. it should work now
