There are also many results if you search for “calculate fov for hitchcock zoom”. For example, this page gives a code sample for Unity which you can adapt for three.js.
You could try this - put in the distance of your object (in world space) to the camera as the z-depth to get the width of the scene at that distance. Then use that width in the calculation.
You should get the distance between the camera and the mesh, not the camera and the target.
Actually I would recommend removing the controls from the scene while you are working on this, and if you do include them, disable them while doing the zoom. Using OrbitControls while doing camera animation is tricky.
You can get the camera distance to the mesh like this:
const a = new Vector3();
mesh.getWorldPosition(a);
const distance = camera.position.distanceTo(a);
Although in this case, you can also just leave the mesh at (0,0,0), then do:
right now the target and mesh is at 0,0,0 so that simplifies stuff ,
i kept orbitcontrols cause its easier to handle framing & i’ll put target at the center of mesh bounding box before starting vzoom
so width is the unknown factor , i’ll try to setup a bounding box size * distance from target * constant factor as default width …once its in the correct ballpark a gui slider can used to add or remove a bit of width.