warp.transform\_vector ====================== .. currentmodule:: warp._src.lang .. function:: transform_vector(xform: Transformation[Float], vec: Vector[Float, Literal[3]]) -> Vector[Float, Literal[3]] .. wp-function-tags:: :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 :func:`~warp.transform_point` to transform positions. :param xform: Transformation whose rotation is applied. :param vec: Direction vector to transform, which need not be normalized. :returns: ``quat_rotate(xform.q, vec)``, equivalent to using homogeneous coordinate ``w = 0``. See :func:`~warp.transform_point` for a usage example. .. function:: transform_vector(mat: Matrix[Float, Literal[4], Literal[4]], vec: Vector[Float, Literal[3]]) -> Vector[Float, Literal[3]] :noindex: .. wp-function-tags:: :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 :func:`~warp.transform_point` to transform positions. :param mat: Transformation matrix, applied to a column vector. :param 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 :func:`~warp.transform_point` for a usage example.