tfg.rendering.utils.transform_homogeneous

Applies 4x4 homogenous matrix transformations to xyz vertices.

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.

matrices A tensor of shape [batch, 4, 4] containing batches of view projection matrices.
vertices A tensor of shape [batch, num_vertices, 3] containing batches of vertices, each defined by a 3D point.

A [batch, N, 4] Tensor of xyzw vertices.