Size object Box3, after applyMatrix4

After apply Matrix4 the object get extrange size result.

let obj = TC.transformControls.object;
let m = new THREE.Matrix4();
m.set(trans.rot.get(0) * trans.sle, trans.rot.get(1) * trans.sle, trans.rot.get(2) * trans.sle, trans.tra.get(0),
trans.rot.get(3) * trans.sle, trans.rot.get(4) * trans.sle, trans.rot.get(5) * trans.sle, trans.tra.get(1),
trans.rot.get(6) * trans.sle, trans.rot.get(7) * trans.sle, trans.rot.get(8) * trans.sle, trans.tra.get(2),
0, 0, 0, 1);

let vec3 = new THREE.Vector3();
let box3 = new THREE.Box3().setFromObject(obj);
let radius = box3.getBoundingSphere(new THREE.Sphere()).radius;

The “radius” variable give a unexpected size…

It seems somthing easy but i cant find the way to resolve it correclty. Thank you so much.

It would be nice to share online debuggable example (CodePen, CodeSandBox, JSFiddle). Otherwise it is hard to foresee the meaning of “unexpected size” Nevertheless, here are a few comments:

  • bounding boxes are axes aligned, as a result, the bounding box might appear larger than expected
  • setFromObject may give a larger than expected result if it is used without a second parameter precise=true
  • getBoundingSphere is run on the bounding box, not on the object, so the result might be even bigger, than expected.