warp.transform_vector#

warp.transform_vector(
xform: Transformation[Float],
vec: Vector[Float, Literal[3]],
) Vector[Float, Literal[3]]#
  • Kernel: true
  • Python: true
  • Differentiable: true

Return vec transformed by the rotation of xform, ignoring its translation.

xform.q must have unit length; otherwise the result may distort. Use transform_point() to transform positions.

Parameters:
  • xform – Transformation whose rotation is applied.

  • vec – Direction vector to transform, which need not be normalized.

Returns:

quat_rotate(xform.q, vec), equivalent to using homogeneous coordinate w = 0.

See transform_point() for a usage example.

warp.transform_vector(
mat: Matrix[Float, Literal[4], Literal[4]],
vec: Vector[Float, Literal[3]],
) Vector[Float, Literal[3]]
  • Kernel: true
  • Python: true
  • Differentiable: true

Return vec transformed by the 4x4 matrix mat, using homogeneous coordinate w = 0.

Matrices that use row-vector conventions, such as those from USD, must be transposed. When mat contains non-uniform scale, transform normals using the inverse transpose of its upper-left 3x3 linear component, then normalize the result. Use transform_point() to transform positions.

Parameters:
  • mat – Transformation matrix, applied to a column vector.

  • vec – Direction vector to transform, which need not be normalized.

Returns:

The first three components of mat * (vec.x, vec.y, vec.z, 0), ignoring translation.

See transform_point() for a usage example.