-
I have a scene set up with a camera pointing down at the origin, like 'to_world': T.look_at(
origin=[0, 0, 10],
target=[0, 0, 0],
up=[0, 1, 0]
) Now I just want to do a quick perspective transformation from some 3D points in my scene to see where they may appear in the image. I've been trying to do this by extracting the projection matrix with: params = mi.traverse(scene)
camera = scene.sensors()[0]
film = camera.film()
prj = mi.perspective_projection(film.size(), film.crop_size(), film.crop_offset(), params['sensor.x_fov'], params['sensor.near_clip'], params['sensor.far_clip']) and then applying to a point like: uv = prj @ mi.Point3f(np.ones(3)) but this is as far as I've got. I don't know how to convert the 3D point that's returned back to an image position, and also using Any suggestions would be very welcome!! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Hi @lopsided Have a look at this discussion: #1138 |
Beta Was this translation helpful? Give feedback.
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...