view source button

THREE js (r89) - Move camera so that object is visible

You could also say "zoom the camera" but true zoom changes the field of view. In this case FOV is fixed.

Math is based off of this THREEjs Discourse discussion: Camera Zoom To Fit Object