Hi Guys,
This may be a simple problem but it is driving me crazy. I have an application that simulates a camera hanging in outer space. It’s rotation is controlled by the joystick and a quaternion is used to store the camera’s current orientation, and have a function that translates the quaternion to an OpenGL transformation matrix.
My problem is that to position the camera, I have to invert the matrix (since I want the quaternion to represent the camera’s orientation rather than a camera transformation), but whenever I pull up on the joystick, the resulting change depends on the current heading of the object. It will be something between a pitch and a roll change. I’ve tried all sorts of inverses, from getting the conjugate of the quaternion, or transposing the resulting transformation matrix (transposing should’ve worked since there was no scaling or translating) and when that didn’t work I did a proper inverse of the transformation matrix instead of a transpose and they all do the same thing.
This could be a problem with the Euler angle order but I can’t see how the angle order applies to ‘quaternion to matrix’ conversion.
If sombody could tell where I could’ve gone wrong or an easy way to convert a matrix from moving the local coordinates to a certain orientation to moving the global coordinates to a certain orientation position. Not sure if that made sense but I’ve done my best to explain.