Fit Bounding Box to Screen

Does anyone happen to have a link to the playground example that positions the camera so that the bounding box of a mesh fits the width or height of the screen? I remember seeing this code a while ago. It might have been something @Pryme8 was doing.

Im hoping it works even if you change the focal length of the camera.

Is that what you’r looking for:


Thanks, Necips!