I have a coordinate system where +x is to the right, +y goes into the screen, and +z is up. But it doesn't always quite work out.
I tried baking my camera matrix into my perspective matrix. Is that a mistake? Should people avoid that?
My camera has x rotation, z rotation, and a location. To get my camera matrix, I start from an identity matrix, do the rotations, then translate by the camera location.
Then I have an ortho perspective matrix. I multiply the perspective matrix by the camera matrix and pass that into the shader. Should I keep it separate?
Well, it's all mixed up. Moving the camera +z has the opposite of expected result. y also seems to be flipped when moving the camera. Yet, objects appear on screen as expected. Translating objects on the screen acts as expected.
I think the camera translations need to be inversed?
The model view matrix works exactly as expected. As does the perspective matrix.
OK, OK! Before anyone attacks, I see that the camera does not go into the perspective matrix. I took it out and tacked it onto the model view matrix. Makes sense.
It's still not doing the right thing, but I'll work it out.
Edited by mg_mchenry, 31 August 2012 - 12:29 PM.