gimble lock

3 replies to this topic

New Member

• Members
• 11 posts

Posted 19 May 2005 - 04:22 PM

Hello.

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:

-------START-------
Declare PosX, PosY, PosZ variables
Declare RotX, RotY, RotZ variables

start loop

display camera position and angles

if w key pressed then
insert code to move foward
end if

if s key pressed then
insert code to move backward
end if

if a key pressed then
RotY=RotY-1
end if

if d key pressed then
RotY=RotY+1
end if

if e key pressed then
RotX=RotX-1
end if

if c key pressed then
RotX=RotX+1
end if

if z key pressed then
RotZ=RotZ-1
end if

if x key pressed then
RotZ=RotZ+1
end if

---

can anyone help?

Member

• Members
• 69 posts

Posted 19 May 2005 - 07:40 PM

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.

DS

#3Mihail121

Senior Member

• Members
• 1059 posts

Posted 20 May 2005 - 04:19 AM

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.

#4Kenneth Gorking

Senior Member

• Members
• 939 posts

Posted 28 May 2005 - 12:13 PM

The reason you couldn't find anything on google, is because you spelled it wrong. It's called gimbal lock, not gimble.
"Stupid bug! You go squish now!!" - Homer Simpson

1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users