diff --git a/pytorch3d/renderer/implicit/utils.py b/pytorch3d/renderer/implicit/utils.py index c27870e3..a973bdee 100644 --- a/pytorch3d/renderer/implicit/utils.py +++ b/pytorch3d/renderer/implicit/utils.py @@ -14,6 +14,9 @@ class RayBundle(NamedTuple): RayBundle parametrizes points along projection rays by storing ray `origins`, `directions` vectors and `lengths` at which the ray-points are sampled. Furthermore, the xy-locations (`xys`) of the ray pixels are stored as well. + Note that `directions` don't have to be normalized; they define unit vectors + in the respective 1D coordinate systems; see documentation for + :func:`ray_bundle_to_ray_points` for the conversion formula. """ origins: torch.Tensor @@ -36,6 +39,8 @@ def ray_bundle_to_ray_points(ray_bundle: RayBundle) -> torch.Tensor: + ray_bundle.directions[i, :] * ray_bundle.lengths[i, j] ) ``` + Note that both the directions and magnitudes of the vectors in + `ray_bundle.directions` matter. Args: ray_bundle: A `RayBundle` object with fields: @@ -70,6 +75,8 @@ def ray_bundle_variables_to_ray_points( + rays_directions[i, :] * rays_lengths[i, j] ) ``` + Note that both the directions and magnitudes of the vectors in + `rays_directions` matter. Args: rays_origins: A tensor of shape `(..., 3)`