How does Three.js use ColladaLoader to introduce external models to center?

The

code is as follows. After introducing the model using ColladaLoader, I don"t know how to use Geometry or how to get the size of the model.

var loader = new THREE.ColladaLoader();
var mesh;
loader.load("dae/LuckyStrike/luckystrike.dae", function (result) {
    mesh = result.scene.children[0].clone();
    // 
    // mesh.position.set(-1.4,-1,-.5)
    scene.add(mesh);
});
May.04,2022

self-question and answer, found a way! You can get the midpoint by calculating max-min using the newTHREE.Box3 () function.

loader.load( daeUrl, function (result) {
  mesh = result.scene
  let scaleNum = 1
  let box = new THREE.Box3().setFromObject(mesh);
  //   
  mesh.position.set((-box.max.x - box.min.x) * scaleNum * 20, (-box.max.y - box.min.y) * scaleNum * 20, (-box.max.z - box.min.z) * scaleNum * 20)
  // 
  mesh.scale.set(scaleNum, scaleNum, scaleNum);
  scene.add(mesh);
})
Menu