function autoLocalOneModel(object, camera, controls) {
const box = new THREE.Box3().setFromObject(object);
const boxSize = box.getSize(new THREE.Vector3()).length();
const boxCenter = box.getCenter(new THREE.Vector3());
const sizeToFitOnScreen = boxSize * 0.6;
const halfFovY = THREE.MathUtils.degToRad(camera.fov * .5);
const distance = sizeToFitOnScreen / Math.tan(halfFovY);
const direction = (new THREE.Vector3())
.subVectors(camera.position, boxCenter)
.multiply(new THREE.Vector3(1, 0, 1))
.normalize();
camera.position.copy(direction.multiplyScalar(distance).add(boxCenter));
camera.near = boxSize / 100;
camera.far = boxSize * 100;
camera.updateProjectionMatrix();
camera.lookAt(boxCenter.x, boxCenter.y, boxCenter.z);
controls.maxDistance = boxSize * 10;
controls.target.copy(boxCenter);
controls.update();
}