math & physics
blinkerguy at May 19th, 2005 12:22 — #1
This is stopping my gameprojects dead. The gimble lock.
I've been googling for an article like this but none of them appears to be helpful..
I am trying to make a flight simulator game but I don't know anything about advanced maths.
Using the sample diagram code I display:
Declare PosX, PosY, PosZ variables
Declare RotX, RotY, RotZ variables
display camera position and angles
if w key pressed then
insert code to move foward
if s key pressed then
insert code to move backward
if a key pressed then
if d key pressed then
if e key pressed then
if c key pressed then
if z key pressed then
if x key pressed then
can anyone help?
darqshadow at May 19th, 2005 15:40 — #2
You're using too simple of math for such a complex 3D rotational problem. Switch to matrix math and you can eliminate all of these issues.
mihail121 at May 20th, 2005 00:19 — #3
Yep, this camera system looks too primitive to me too! Try reading through the net about "camera systems" and you'll quickly find what you need. Besides, i don't see anything complex in camera systems unless you want to interpolate between two rotation angles. In that case you'll need basic quaternions but they ain't so hard to understand too.
kenneth_gorking at May 28th, 2005 08:13 — #4
The reason you couldn't find anything on google, is because you spelled it wrong. It's called gimbal lock, not gimble.