Skip to content
Discussion options

You must be logged in to vote

Thanks @njroussel ! I had missed the sensor.world_transform().inverse() bit from that message first time around. It feels a little clunky, but this seems to work ok...

def _project_to_image(self, points: torch.Tensor) -> torch.Tensor:
    """
    Project 3D points to the image plane.
    """
    params = mi.traverse(self.scene)
    sensor = self.scene.sensors()[0]
    film = sensor.film()

    # Create the projection matrix
    prj = mi.perspective_projection(film.size(), film.crop_size(), film.crop_offset(), params['sensor.x_fov'],
                                    sensor.near_clip(), sensor.far_clip())

    # Get the inverse camera world transform
    wti = sensor.world_transform().in…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@lopsided
Comment options

Answer selected by merlinND
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants