I am working on a video game where the camera movement (what the viewer sees) is controlled by a joystick. I want the camera movement to act like a flight simulator meaning the following:
When the user points the joystick "down" (toward the screen) the camera points down ( changing pitch).
When the user moves the joystick sideways the camera just "rolls" along the Z-Axis. By manipulating just these two parameters, the user could go all directions, and this is where I am struggling. How to I calculate the distance in each direction, X, Y, Z the user would go based on those rotations.
For example, if the user rotated along the X axis 90 degrees, future movement would be 100% in the Y direction.
If the user "rolls" along the Z axis, the movement would be 100% in the Z direction but, as soon as there is rotation along the X axis (and rotation along the Z axis), there would be movement in three directions.
This question comes very close to answering, but is basically asking the inverse. I just want to know, given roll and pitch, how do I calculate yaw. Or, how do I figure the distance in X Y and Z based on their rotations. Thanks