c4d.Quaternion

class c4d.Quaternion

Has methods for conversion to and from a rotation matrix: GetMatrix/SetMatrix/SetMatrixNorm.

New in version R17.048.

Attributes

Quaternion.w

The rotation angle.

Type: float

Quaternion.v

The direction vector.

Type: Vector

Methods Signatures

Quaternion.__init__(self) Returns a new Quaternion instance.
Quaternion.GetMatrix(self) Derives a rotation matrix from the quaternion.
Quaternion.SetMatrix(self, m) Derives quaternion values from a rotation matrix.
Quaternion.SetMatrixNorm(self, m) Derives quaternion values from a normalized rotation matrix.
Quaternion.SetHPB(self, hpb) Derives quaternion values from a HPB rotation.
Quaternion.SetAxis(self, ax, ww) Sets the quaternion values directly.

Methods Documentation

Quaternion.__init__(self)

Returns a new Quaternion instance.

Quaternion.GetMatrix(self)

Derives a rotation matrix from the quaternion.

Return type:c4d.Matrix
Returns:The rotation matrix.
Quaternion.SetMatrix(self, m)

Derives quaternion values from a rotation matrix.

Parameters:m (c4d.Matrix) – The rotation matrix to set.
Quaternion.SetMatrixNorm(self, m)

Derives quaternion values from a normalized rotation matrix.

Parameters:m (c4d.Matrix) – The normalized rotation matrix to set.
Quaternion.SetHPB(self, hpb)

Derives quaternion values from a HPB rotation.

Parameters:hpb (c4d.Vector) – The HPB rotation.
Quaternion.SetAxis(self, ax, ww)

Sets the quaternion values directly.

Parameters:
  • ax (c4d.Vector) – The direction vector.
  • ww (float) – The rotation angle.