zoomOn function places the cameras so the distance to the bounding box center of the mesh is large enough to not have the camera in the bounding box.
to make it short, it places the camera, so it’s far enough of the bounding box.
It doesn’t take into account the projected bounding box, the camera fov or the viewport size.
Thanks for letting me know about that.
In that case, if I want to zoom in/out automatically the camera to fit the current viewing bounding box, what could I do?
Do I have to manually calculate the ArcRotateCamera’s alpha, beta, radius?
alpha/beta can be updated just by setting the target (center of bounding box).
The real deal is to set the distance to the center that will give the projected bounding box to be entierly framed by the viewport.
as usual depending on the quality, this will need some work.
if you assume the bounding sphere is enough, then you can compute the distance so the projected disk is framed by the viewport.
for the viewport, you only need the ratio width/height I think. the closer to 1, the more you can zoom.
and use the fov value from the camera aswell.