# Camera coordinate system flipped?

I'm looking do make an FPS-like camera, but I'm encountering some problems. If I'm first rotating and then translating the camera, everything works fine, but the coordinate system. For example, if I want to go backward with the camera, I have to set the Y coordinate positive. But when I'm translating a model matrix on the Y coordinate in a positive direction, it is moving forward. So somehow the coordinate system is flipped.

When I'm first translating the camera and then rotating, the coordinate system is the same, but now the camera is rotating around the origin, which makes sense, but when I'm looking at examples, everyone does that and no one is complaining about rotating around the origin.

I hope you understand what I mean and I hope you can give me some advice.

• Rotations are allways around the origin! If you want to have something rotated around an arbitrary point you need to do the rotation first and then apply the translation. Commented Aug 6, 2013 at 11:56
• Yes, I'm aware of that. But the core problem is something else.
– RenX
Commented Aug 6, 2013 at 12:04
• Can you tell us a little more about how you do your math and create your matrices and how you multiply and pass them to the renderer? This is probably a problem with how you setup your matrices so that would be useful information. Commented Aug 6, 2013 at 12:15
• I'm using GLM. I set the view matrix in an camera class. I'm using glm::rotate three times for X, Y and Z and then I multiply them by the translation matrix(glm::translate). Then I'm multipling the Model-, View- and Projection matrices in the shader.
– RenX
Commented Aug 6, 2013 at 12:25
• "I want to go backward with the camera, I have to set the Y coordinate positive" When you have an unrotated camera the Y-Axis usually points up, X points to the right and you look along the negative Z-axis. Of course this is just depending on how your matrices look like but that´s GLSL standart and GLM follows the same convention for it´s inbuilt functions. Commented Aug 6, 2013 at 13:32