Hi There,
I think that if you look closer there is more weirdness than you think, in that when you point your object up, it rolls instead of turning.
You need to rotate on the Z axis as well as the X and Y, because when facing up, you need to turn on the z axis to give the feeling of turning left or right on your own axis.
You can use sine and cosine to decide how much each rotational axis (Y and Z) needs to be rotated, and (believe it or not) this will fix your rotation totally(ie: no more craziness in the land of the upside-down).
Howeber it will screw up your current sine cosine code for apllying drectional motion to your ship, which I imagine looks something like this:
public Vector3 cosine3D(Vector3 thisrot){ //recognize this? (conert rotaton X & Y to a position vector)
Vector3 newVec = Vector3.Zero;
newVec.X = -(
float)Math.Sin(thisrot.Y);
newVec.Z = -(
float)Math.Cos(thisrot.Y);
newVec.Y = (
float)Math.Sin(thisrot.X);
newVec.X = (
float)Math.Cos(thisrot.X) * newVec.X;
newVec.Z = (
float)Math.Cos(thisrot.X) * newVec.Z;
return (newVec);
}
What we probably both need to be able to do (and I can't I'm afraid, I'm useleess at trig) is get the rot.Z into the equation.
If you can re-figure out this equation with the new added rotational axis, I'll gladly write and post the code for applying the rotation properly (I know it works with the rotational bit, but deleted the code on discovering how it messed my translational information up). It also means ignoring Quaternions for a bit, which I would appreciate, as they seem hellishly long winded and intense.
Cheers,
James