warp.transform_identity#

warp.transform_identity(dtype: Float = ...) transformf#
  • Kernel: true
  • Python: true
  • Differentiable: false

Construct an identity transform with zero translation and identity rotation.

The result is neutral under composition and leaves points and vectors unchanged. Unlike a zero-argument transformation(), it contains a valid rotation quaternion.

Parameters:

dtype – Scalar type of the components. Defaults to float32.

Returns:

The identity transformation.

Example

@wp.kernel
def reset(out: wp.array[wp.transform]):
    i = wp.tid()
    out[i] = wp.transform_identity()

out = wp.empty(2, dtype=wp.transform)
wp.launch(reset, dim=out.shape, outputs=[out])
print(out.numpy())
[[0. 0. 0. 0. 0. 0. 1.]
 [0. 0. 0. 0. 0. 0. 1.]]