Hi, I am working on a video game where the camera movement (in this case 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 (think of this as tilting along the X axis (left to right of screen), or changing pitch, I believe)
When the user moves the joystick side to side, the camera just "rolls" along the Z-Axis (with the Z axis being the one that would protrude out from the screen).
By manipulating just these two controls, 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, the movement would be 100% in the Y direction but,
regardless of how much 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 multiple directions
(i.e. a 90 degree "roll" on the Z axis coupled with a 90 rotation on the X axis would result in a 100% move in the X direction).
This is basically like using the aileron and wings of a plane. In two dimensions this is as simple as the unit circle, but I am lost when it comes to three. Please help, thanks.