camera framing an object based on bounding box?

   2650   2   0
User Avatar
Member
52 posts
Joined:
Offline
Hi all,

Anyone has any idea how I would change the distance of a camera to the center of an object, so that the camera always frames exactly the length of its bounding box X value ?

This way a I could have an automatic camera for rendering different objects always nicely framed. Regardless of the camera lens.

Any tips/examples?

Thanks!
User Avatar
Member
1 posts
Joined: Oct. 2019
Offline
I'm doing something like this
5 + 3.2 * bbox(0, max(D_XSIZE, D_YSIZE))/(2*1.3333)
for the camera z translation parameter. Your constants will vary. This is for 36 aperture and 36 focal length, giving me a FOV of about 53 degrees AFAICT, the tan of which yields the 1.3333.

The output of my geo is going into the camera.
User Avatar
Member
5 posts
Joined: Dec. 2017
Offline
Can you explain your formula. Where you take this constant values?
Thanks!
  • Quick Links