warp.transform_compose#

warp.transform_compose(
position: Vector[Literal[3], float32],
rotation: Quaternion[float32],
scale: Vector[Literal[3], float32],
) None#
  • Kernel

  • Differentiable

Compose a 4x4 transformation matrix from a 3D position, quaternion orientation, and 3D scale.

\[\begin{split}M = \begin{bmatrix} s_x R_{00} & s_y R_{01} & s_z R_{02} & p_x \\ s_x R_{10} & s_y R_{11} & s_z R_{12} & p_y \\ s_x R_{20} & s_y R_{21} & s_z R_{22} & p_z \\ 0 & 0 & 0 & 1 \end{bmatrix}\end{split}\]

Where:

  • \(R\) is the 3x3 rotation matrix created from the orientation quaternion of the input transform.

  • \(p\) is the 3D position vector \([p_x, p_y, p_z]\) of the input transform.

  • \(s\) is the 3D scale vector \([s_x, s_y, s_z]\) of the input transform.

Parameters:
  • position (Vector[3, Float]) – The 3D position vector.

  • rotation (Quaternion[Float]) – The quaternion orientation.

  • scale (Vector[3, Float]) – The 3D scale vector.

Returns:

The transformation matrix.

Return type:

Matrix[4, 4, Float]