Skip to content

eulertoquaternion

Unit quaternions are used to represent rotations. This VEX function creates a unit quaternion that represents a rotation.

vector4  eulertoquaternion(vector rotations, int order)

Creates a vector4 representing a unit quaternion from a vector representing Euler rotations in X, Y, and Z.

The angles are in radians. Use the radians() function to convert degrees into radians.

order

One of the rotation order constants listed below, which can be imported from $HFS/houdini/vex/include/math.h.

Constant nameRotation Order
XFORM_XYZRotate order X, Y, Z
XFORM_XZYRotate order X, Z, Y
XFORM_YXZRotate order Y, X, Z
XFORM_YZXRotate order Y, Z, X
XFORM_ZXYRotate order Z, X, Y
XFORM_ZYXRotate order Z, Y, X