透视相机,实现相机根据模型大小自适应,将模型放置在视角内
const box3_2 = new THREE.Box3().setFromObject(object); //新建一个Box3包裹盒把模型包裹起来
const boxSize = box3_2.getSize(new THREE.Vector3()).length(); //综合计算出模型的长度值,利用它设置相机位置
boxCenter = box3_2.getCenter(new THREE.Vector3());
const fov = camera.fov * (Math.PI / 180);
const cameraZ = boxSize / 2 / Math.tan(fov / 2);
camera.position.z = cameraZ;