- #1

- 4

- 0

## Main Question or Discussion Point

Hey there,

I have a question regarding quaternions and rotations. It's related to 3D graphics programming, but nevertheless I'm sure the physics forum is the right place for my question.

As far as I've understood there are 3 primary ways we can store rotation: euler angles, quaternions and matrices. In 3D graphics programming, quaternions are often the preferred way because they need less memory than matrices but avoid gimbal lock.

To represent a 3D object with euler angles I just need 3 components: x, y and z, which each represent the angle around an axis.

Now, how many quaternions are needed to store a rotation? To my knowledge a quaternion stores an axis and the amount of rotation - so I'd need 3 quaternions to store a rotation - is that right? That would be 3 (quaternions) x 4 (values) = 12 values to be stored. To store a rotation in a matrix I would need 3 x 3 = 9 values, which is even less. So why not just use matrices? Why do quaternions need less values/memory than matrices? Do I really need 3 quaternions to represent a rotation?

Greetings!

I have a question regarding quaternions and rotations. It's related to 3D graphics programming, but nevertheless I'm sure the physics forum is the right place for my question.

As far as I've understood there are 3 primary ways we can store rotation: euler angles, quaternions and matrices. In 3D graphics programming, quaternions are often the preferred way because they need less memory than matrices but avoid gimbal lock.

To represent a 3D object with euler angles I just need 3 components: x, y and z, which each represent the angle around an axis.

Now, how many quaternions are needed to store a rotation? To my knowledge a quaternion stores an axis and the amount of rotation - so I'd need 3 quaternions to store a rotation - is that right? That would be 3 (quaternions) x 4 (values) = 12 values to be stored. To store a rotation in a matrix I would need 3 x 3 = 9 values, which is even less. So why not just use matrices? Why do quaternions need less values/memory than matrices? Do I really need 3 quaternions to represent a rotation?

Greetings!