Hi,
I’m trying to get a camera to dynamically adjust its field of view based on the 3D model size that the camera is focusing on. Such that the camera can see the entire model and not just part of it.
For example in this camera tutorial (https://developer.playcanvas.com/en/tutorials/more-cameras/)
I’d like the camera Field of View to auto-adjust based on the plane size. So if the plane get’s bigger the filed of view should increase so that the entire plane is visible, and if the plane gets smaller then the filed of view should decrease until the point where it chips of part of the plane (zoom in, to focus on the plane)
How to go about this? Some magic with raycasting at an angle to detect if the object was collided by the ray or any easier way?