Quaternion

Overview

Quaternion is a class in Aspose.3D FOSS for Python.

Quaternion.normalize() returns a new Quaternion with unit length without modifying the original instance.

This class declares 19 methods for Quaternion objects in Python programs. Available methods include: __eq__, __init__, __repr__, concat, conjugate, dot, euler_angles, from_angle_axis, from_euler_angle, from_rotation, get_IDENTITY, get_bind_point, and 7 additional methods. Public members are accessible to any Python application after installing the Aspose.3D FOSS for Python package. Properties: length, w, x, y, z.

Properties

NameTypeAccessDescription
wfloatRead/WriteGets or sets the w.
xfloatRead/WriteGets or sets the x.
yfloatRead/WriteGets or sets the y.
zfloatRead/WriteGets or sets the z.
lengthfloatReadGets the length.

Methods

SignatureDescription
__init__(w, x, y, z)Calls init(w, x, y, z) on this Quaternion instance.
get_IDENTITY() → 'Quaternion'Returns the identity.
normalize() → 'Quaternion'Returns a new Quaternion representing the unit‑length version of the original quaternion
conjugate() → 'Quaternion'Returns the conjugate of the quaternion (negates the vector part)
inverse() → 'Quaternion'Returns the inverse rotation quaternion
dot(q: 'Quaternion') → floatComputes the dot product with another quaternion
concat(rhs: 'Quaternion') → 'Quaternion'Returns the concatenation (multiplication) of this quaternion with another
euler_angles() → 'Vector3'Returns the rotation expressed as Euler angles as a Vector3
to_matrix(translation) → 'Matrix4'Converts the quaternion (and optional translation) to a 4x4 matrix
to_angle_axis(angle, axis)Converts the quaternion to angle‑axis representation, outputting angle and axis
from_euler_angle(pitch, yaw, roll) → 'Quaternion'Creates a quaternion from pitch, yaw and roll angles
from_angle_axis(a: float, axis) → 'Quaternion'Creates a quaternion from an angle and an axis vector
from_rotation(orig, dest) → 'Quaternion'Creates a quaternion representing rotation from orig to dest vectors
interpolate(t: float, from_q: 'Quaternion', to_q: 'Quaternion') → 'Quaternion'Returns a linearly interpolated quaternion between two quaternions at t
slerp(t: float, v1: 'Quaternion', v2: 'Quaternion') → 'Quaternion'Returns a spherical linear interpolation between two quaternions at t
get_keyframe_sequence(anim, create)Not implemented in the FOSS edition — throws at runtime. Retrieves or creates a keyframe sequence for an animation
get_bind_point(anim, create)Not implemented in the FOSS edition — throws at runtime. Retrieves or creates a bind point for an animation
__repr__() → strCalls repr on this Quaternion instance.
__eq__(other) → boolCalls eq(other) on this Quaternion instance.

See Also

 English