# Thread: Avoid Gimbal Lock, How?

1. ## Avoid Gimbal Lock, How?

What causes gimbal lock and how do you avoid it?

2. ## Re: Avoid Gimbal Lock, How?

Avoiding it is best, but if you've already got it, I think that Johnson and Johnson make a cream that will clear it up....

Seriously. Gimbal lock is caused when you get your rotational axis into a configuration where you don't really have three independent degrees of freedom anymore. The rotational axis are only independent as long as they stay orthogonal to each other. The typical solution is to use quaternions, which I won't attempt to explain, but you should be able to do a search and come up with some explanations.

3. ## Re: Avoid Gimbal Lock, How?

definitely quaternions.

to help w/ the search.
http://www.cs.berkeley.edu/~laura/cs...uaternion.html
http://www.darwin3d.com/gamedev.htm#gdm0398

the former is a technical description, while the latter is an actual implemenation by jeff lander

i recommend the latter, as jeff lander is the man

4. ## Re: Avoid Gimbal Lock, How?

I understand Bob's definition of Gimbal Lock, however how can you achive that in OpenGL? Is it possible to get a gimbal lock only with translations, rotation and scales?

Antonio

5. ## Re: Avoid Gimbal Lock, How?

Gimbal lock is an issue when messing with Euler angles ONLY, and has nothing to do with matrices or OpenGL. One solution is indeed quaternions, but why use quaternions? They don't give you anything you can't do with matrices. And remember, when using quaternions, you have to convert them to matrices to use them in OpenGL, so why not stick to matrices in the first place, and skip this conversion?

Gimbal lock occurs when you are using rotations in the wrong (or a not-so-smart) way.

6. ## Re: Avoid Gimbal Lock, How?

gimbal lock is basically applying rotation/translation etc, in the wrong order (remember, order IS important), and you get undesired results.

#### Posting Permissions

• You may not post new threads
• You may not post replies
• You may not post attachments
• You may not edit your posts
•