I started writing a camera class today (my first one) and its mostly done except one little thing that I can’t seem to get right. First of all the camera is set up like a camera for a first person shooter, mouse looks around and ASDW moves. My problem is that when I turn my mouse I need the camera’s translation to be rotated too. In other words, if I turn around 180 degrees using my mouse and then press the forward button, it should move me backwards. I tried multiplying my velocity by the same matrix that I use to rotate the camera, but I’m getting weird results. The directions seem to reverse sometimes, up goes down etc. its actually worse than this because sometimes up could move me left or right when pressing up. I’m just wondering if this is the right approach or if there is a better way to do it… how do you do it?
well, it depends on how you’re actually DOING your camera at the moment, You don’t really say. Sounds like a classic example of gimbal lock to me. The way I’ve had my camera set up for quite some time seems to be the most widespread and convenient usage ( disregarding quaternion solutions ). I have 3 orthogonal vectors representing the Orthonormal base of the camera’s transformation system. Essentially these can be plugged directly into a 3x3 matrix to compose the rotation part of the camera’s transformation. When rotating I rotate two of the camera normals around the target normal. Every now and again you have to re-normalise to ensure its still orthogonal.
This has its advantages because you always have ready access to the three normals that represent the cameras view direction, the cameras ‘up’ direction and the ‘side’ direction of the camera. You can use these for a multitude of things, such as panning and dollying the camera, using the ‘up’ and ‘side’ vectors to construct billboards, etc etc.
Theres quite a few good tutorials on the net about the best way to construct your camera class, I’d suggest a bit of googling 
D.
The first method I used for implementing my camera class was actually the same method that you described. I was having the same problem I’m having now though, so I decided to switch to quaternions to avoid gimbal lock and hopefully find a solution to the movement problem. Sounds like I could have been ill informed when I read that gimbal lock could also occur using this method? So I currently have access to my forward vector and (correct me if I’m wrong) I should be able to calculate my up and side vectors from there. This is the part I don’t get though, what do I need to do with this to rotate my movement (or my velocity, however you want to think about it) so that pressing forward will move me in the direction I’m facing (needs to work for left/right/back as well though). I’m guessing its going to be something fairly simple since none of the tutorials I read actually mentioned anything about it explicitly, which is why I would bother to ask on here. I was feeling about worn out on the subject yesterday (ready to give up more like it), but today’s a new day and it looks like its time to go back to google…