View source on GitHub |
Applies 4x4 homogenous matrix transformations to xyz vertices.
tfg.rendering.utils.transform_homogeneous(
matrices: type_alias.TensorLike, vertices: type_alias.TensorLike
) -> tf.Tensor
The vertices are input and output as as row-major, but are interpreted as column vectors multiplied on the right-hand side of the matrices. More explicitly, this function computes (MV^T)^T where M represents transformation matrices and V stands for vertices. Since input vertices are xyz they are extended to xyzw with w=1.
Returns | |
---|---|
A [batch, N, 4] Tensor of xyzw vertices. |