When to use quaternion?

I’m learning three.js and it makes confused in handling rotations. I know the differences between Euler Angles and Quaternion. Quaternion solves the rotation problem better. But I constantly see demos on the Web using Euler Angles to control rotations. But isn’t Quaternion better? Do people prefer Euler Angles since it’s simpler? When will people choose using Quaternion?

Guides on how to use Quaternion will also be helpful. Thanks.

People use Eulers for a few reasons:

  • they are simpler for beginners to understand
  • some other apps use them so it can be easier to bring code/models from these apps
  • other people will understand your code more easily

For these reasons, most beginner friendly tutorials and examples will use Euler angles. Basically, while Euler angles and normal intuitive understanding of rotation around the x, y, z axes are not identical, they are close enough that in most cases it doesn’t make a difference. You could explain to an 8 year old how Euler angles work pretty easily.

Whereas if you write a beginner friendly tutorial using quaternions, then most of your tutorial will involve explaining to your readers what quaternions are and how to use them. This is why most tutorials use Eulers.

So, if you are comfortable using quaternions and not in a situation where other people who are not will have to work with your code, then you should probably be using them.

1 Like

If you want a more comprehensive explanation, you should read the chapter “Rotation in Three Dimensions” of 3D Math Primer for Graphics and Game Development. It discusses different forms of representation methods of angular displacement. Of course with listing advantages/disadvantages.


1 Like