# OpenGL Quaternions, just more math?

This topic is 4959 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

Hi. After reading into some quaternions articles and tutorials, I think I get what they do and how they do it. But for as far I've read by now they have no advantage using them in my OpenGL camera, instead of using my own 3 rotation values and glRotatef. (they only expand your glmath.cpp ;-)) Can someone explain to me what the advantages of a quaternion camera are? (likewise for quaternion rotations for my objects) Thanks.

##### Share on other sites
Probably IMO that Quaternions don't suffer from Gimbal lock.

##### Share on other sites
Gimbal lock is a problem of parameterization, not representation. If you create a rotation by multiplying quaternions representing euler angles you'll still suffer from gimbal lock.

The benefits of quaternions:

i) Smaller representation (4 vs 9 or 16 values) - maybe useful for storage or transmission.

ii) Interpolation. Try interpolating smoothly between rotations represented by matrices. You can't (at least not robustly and easily).

iii) Easy normalization. If you perform long strings of concatentations your final value is likely to be unnormalized (i.e. a rotation-plus-scale). While you can normalize matrix representations it is far easier to do it with quaternions.

There are probably other benefits but these are the main ones for gfx/game programming. Of course there are also downsides, and you'll eventually have to convert to matrix rep anyway for GPUs.

##### Share on other sites
Thanks for the explanation.
Sounds like I'm not gonna use them yet, maybe later.

1. 1
2. 2
Rutin
19
3. 3
4. 4
5. 5

• 14
• 12
• 9
• 12
• 37
• ### Forum Statistics

• Total Topics
631425
• Total Posts
3000011
×