Get the maximum dimension of a bounding box
The bounding box
The largest dimension (x, y, or z)
const bbox = new THREE.Box3().setFromObject(model);const maxDim = getMaxDimension(bbox);const cameraDistance = maxDim * 2; // Position camera based on size Copy
const bbox = new THREE.Box3().setFromObject(model);const maxDim = getMaxDimension(bbox);const cameraDistance = maxDim * 2; // Position camera based on size
Get the maximum dimension of a bounding box