# Size object Box3, after applyMatrix4

**URL:** <https://discourse.threejs.org/t/size-object-box3-after-applymatrix4/53155>\
**Category:** Questions\
**Tags:** box3, matrix4, geometry\
**Created:** [June 23, 2023, 4:12pm UTC](https://discourse.threejs.org/t/size-object-box3-after-applymatrix4/53155 "2023-06-23T16:12:42Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Agustin\_Costa\_Cimadevilla](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.threejs.org/agustin_costa_cimadevilla/32/19320_2.png) [@Agustin\_Costa\_Cimadevilla](https://discourse.threejs.org/u/Agustin_Costa_Cimadevilla)\
**Post date:** [June 23, 2023, 4:12pm UTC](https://discourse.threejs.org/t/size-object-box3-after-applymatrix4/53155/1 "2023-06-23T16:12:42Z")

</div>

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);  
obj.applyMatrix4(m);

let vec3 = new THREE.Vector3();  
let box3 = new THREE.Box3().setFromObject(obj);  
box3.getSize(vec3);  
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.

---

<div class="post-metadata">

**Author:** ![PavelBoytchev](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.threejs.org/pavelboytchev/32/38639_2.png) [@PavelBoytchev](https://discourse.threejs.org/u/PavelBoytchev)\
**Post date:** [June 23, 2023, 5:42pm UTC](https://discourse.threejs.org/t/size-object-box3-after-applymatrix4/53155/2 "2023-06-23T17:42:54Z")

</div>

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.
