What is the difference between rotation, rotationQuaternion, rotate(), addRotation()?

Hello :slight_smile:

  • rotation: BABYLON.Vector3 defining the rotation of a mesh in EULER mode
  • rotationQuaternion: BABYLON.Quaternion (see it as a Vector4) defining the rotation of a mesh in QUATERNION mode
  • rotate(): Method for rotating around a specific axis
  • addRotation(): Method for adding Euler angles to the current rotation

Now if you wonder why using Quaternion, it’s usefull because it a way to avoid the Gimbal Lock problem of euler angles.

Best way to understand it is to open Blender and :

  • Rotate a cube 90° on Y axis
  • Now you cannot rotate global X anymore. Both X and Z rotation seems to be influencing the global Z axis and you are basically stuck. Rotating global X is now impossible.

gimbal_lock

++
Tricotou

3 Likes