Jump to content

Camera auto framing


Recommended Posts

Hello,
I am currently trying to build a asset turntable tool, most things are fine, but now i am looking for a way to automatically move the camera for and back in z to make sure, that the framing of the object is good (not too far away and not too close to avoid any clipping).
The camera has no rotation. using the center of the bounding box of my asset as y position and the focal length is also fixed.
whats the best approach to calculate the distance in z ?


thank you for the help!

Edited by Crustedink
Link to comment
Share on other sites

21 hours ago, tamagochy said:

I'm using this:


(max(bbox(-1,D_ZSIZE),max(bbox(-1,D_XSIZE),bbox(-1,D_YSIZE)))/2)/sin(2*atan((ch("../cam1/aperture")/2)/ch("../cam1/focal"))/2)

bounding box of the render object

thanks for the reply, sorry for the silly question, but can you explain it a bit further ? so where and how are you using it ?

-//edit
NVM, its workign now. thank you

 

Edited by Crustedink
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...