Cough. He wants to save the rotations. It is the gimbal lock problem.
Note however my understanding is that at -90 and 90 pitch, yaw and roll are combined, so you will never get them back separately but the effect of applying these values should be the same. Well it seems to work above anyway, but I have not tested it properly. Fredborg posted some functions here
www.blitzbasic.com/Community/posts.php?topic=31781
to get global pitch yaw and roll in these circumstances, and they may be more suitable as they use a temporary pivot and will not disturb the original entity.
If KeyDown(28) Then;---How do I make this not change the cube's angle?--- gpitch#=EntityPitch(cone,1) If Abs(EntityPitch(cone,1))>89.98 Then TurnEntity cone,90,0,0,1 gyaw#=EntityYaw(cone,1) groll#=EntityRoll(cone,1) TurnEntity cone,-90,0,0,1 Else gyaw#=EntityYaw(cone,1) groll#=EntityRoll(cone,1) EndIf RotateEntity Cone,gpitch,gyaw,groll End If
Note however my understanding is that at -90 and 90 pitch, yaw and roll are combined, so you will never get them back separately but the effect of applying these values should be the same. Well it seems to work above anyway, but I have not tested it properly. Fredborg posted some functions here
www.blitzbasic.com/Community/posts.php?topic=31781
to get global pitch yaw and roll in these circumstances, and they may be more suitable as they use a temporary pivot and will not disturb the original entity.