I'm developing a flight simulator based on Riemer's Blog tutorial (XNA C#). To control the aircraft, I use the following code:
Quaternion additionalRotation = Quaternion.Identity;
additionalRotation *= Quaternion.CreateFromAxisAngle(Vector3.Forward, roll);
additionalRotation *= Quaternion.CreateFromAxisAngle(Vector3.Right, pitch);
model_ROTATION *= additionalRotation;
This only executes pitch and roll. I wanted to add code so that if the aircraft is rolling, then it should rotate to right or left (yaw) so I changed the code to the following:
Quaternion additionalRotation = Quaternion.Identity;
additionalRotation *= Quaternion.CreateFromAxisAngle(Vector3.Forward,roll);
additionalRotation *= Quaternion.CreateFromAxisAngle(Vector3.Up, yaw);
additionalRotation *= Quaternion.CreateFromAxisAngle(Vector3.Right, pitch);
model_ROTATION *= additionalRotation;
This behaviour is not so realistic; when I roll the aircraft rotates to right/left (yaws), but at the same time it loses altitude and I must pitch up (pull handle) to avoid crashing.
Is there any solution to make slew rotation (yaw) without losing altitude.