Moving the camera in 3D space

I’m having trouble rotating my camera so that it points upwards from the exact position it’s in. I’m using LibGDX and I have a button that executes this statement…


camera.rotate(.3f, 1, 0, 0);

The camera will only rotate upwards if it’s facing away from -z. It will begin to point downwards if it’s pointing towards +z. Anywhere in between, and it does a strange offset loop.

I don’t have the code for camera.rotate but you probably rotate relative to the game coordinate system instead of the camera coordinate system. You just need to reverse the order of operations i.e. apply the matrix/quaternion of the camera to the rotation matrix/quaternion, not the other way around.

This is the only movement I have left to figure out. I can’t seem to figure it out though.