PDA

View Full Version : Flight Simlulator



Funkyplant
09-12-2001, 08:11 AM
I am making a space flight simulator in opengl and I am new to it. My failed attempts to have normal controls in the game are started to wear my patience. Problem: using input from my MacAlly AirStick (kicks ass!) I try to fly around a simple ship. However the polar (or spherical if you prefer) coordinate system makes it impossible to have an angle of roll, pull up and circle completely around. What happens is the controls act funny and I basically get stuck at the north and south axis. I tried inputing in vector coordinates (took a while to get calcs working right) then convert to polar, it works well except there are reminants of the old problem...I still get stuck at the axis. What am I doing wrong?

At the moment I am only Rotating() before I draw the ship. Is this wrong? HELP!!!

[This message has been edited by Funkyplant (edited 09-12-2001).]

Ronan
09-14-2001, 12:57 AM
I'm not sure if this is the problem, but flight sims can have problems when you are calculating tangents of pitch (nose up/down).
basically 90 degrees nose up generates infinity as the tangent, and computers don't like it.
if this sounds like the problem, try a simple if loop to force the 90 degrees to 89.9999 or something similar. this should work, but if not, then your problem is something completely different.

zed
09-14-2001, 03:28 PM
that could be it though s/he might be seeing gimbal lock see here http://web2.airmail.net/sjbaker1/omniv.html
(why eulars are evil)