Home Search

DriveWorks Pro 21
Rotation And Orientation

Send Feedback

Rotation and Orientation in DriveWorks 3D

Summary

Rotations in 3D applications are usually represented in one of two ways, Quaternion or Euler angles. Each has its own uses and drawbacks.

DriveWorks uses Quaternion units internally, but surfaces the equivalent Euler angle to make it easy to edit.

The difference between Euler Angles and Quaternions

Euler Angles

Euler angles have a simple representation. They are represented by three angle values for Y, X and Z that are applied sequentially. To apply a Euler rotation to a particular node, each rotation value is applied in turn, as a rotation around its corresponding axis.

  • Benefit: Euler angles have an intuitive easily readable format, consisting of three angles.
  • Benefit: Euler angles can represent the rotation from one orientation to another through a turn of more than 180 degrees
  • Limitation: Euler angles suffer from Gimbal Lock. When applying the three rotations in turn, it is possible for the first or second rotation to result in the third axis pointing in the same direction as one of the previous axes. This means a degree of freedom has been lost, because the third rotation value cannot be applied around a unique axis.
When applying angles, apply them in the order Y, X, Z.
Standard GimbalX RotationGimbal Lock

Quaternions

Quaternions are used to represent the orientation or rotation of a node. DriveWorks stores the orientation of each node in 3D Space as a Quaternion and this represents a rotation in 3D Space.

  • Benefit: Quaternion rotations do not suffer from Gimbal Lock.
  • Limitation: A single quaternion cannot represent a rotation exceeding 180 degrees in any direction.
  • Limitation: The numeric representation of a Quaternion is not intuitively understandable.

In DriveWorks all node rotations are stored internally as Quaternions.

In DriveWorks Administrator the rotation values are displayed in Euler angles. This is more easily understood and edited.

A side effect of Quaternions is that it is possible for a DriveWorks 3D Document to display a different Euler angle than the value that is entered.

For example:

Entering an angle of 365 degrees for the X Rotation of a node will result in a value of 5 degrees being shown.

This is because the rotation was converted to a Quaternion which does not have the concept of a full 360 degree rotation plus 5 degrees. Instead this has simply been represented by the value 5, the result of the rotation.