# Incorrect bounding box after group rotation with an object

**URL:** https://discourse.threejs.org/t/incorrect-bounding-box-after-group-rotation-with-an-object/38930
**Category:** Questions
**Tags:** geometry
**Created:** [June 6, 2022, 3:00pm UTC](https://discourse.threejs.org/t/incorrect-bounding-box-after-group-rotation-with-an-object/38930 "2022-06-06T15:00:02Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![womas](https://avatars.discourse-cdn.com/v4/letter/w/34f0e0/32.png) [@womas](https://discourse.threejs.org/u/womas)
#### Post date: [June 6, 2022, 3:00pm UTC](https://discourse.threejs.org/t/incorrect-bounding-box-after-group-rotation-with-an-object/38930/1 "2022-06-06T15:00:02Z")

</div>

I have a smooth Sphere with a radius of 1000 inside a group, a group inside the scene. All three entities are located at the origin of coordinates. Without group rotation,  
`new THREE.Box3().setFromObject(sphere)`  
returns the correct result:

```javascript
min: Vector3 {x: -1000, y: -1000, z: -1000}
max: Vector3 {x: 1000, y: 1000, z: 1000}

```

![Image001638](https://canada1.discourse-cdn.com/flex035/uploads/threejs/original/3X/0/1/015eac711661af9e0a7dbb81d4a1f1a17fe9bce4.png)

But if I rotate the group a bit (around the origin), getting the bounding dimensions returns the wrong result:

```javascript
min: Vector3 {x: -1000, y: -1414.0882614332995, z: -1414.0882614332995}
max: Vector3 {x: 1000, y: 1414.0882614332995, z: 1414.0882614332995}

```

![Image001639](https://canada1.discourse-cdn.com/flex035/uploads/threejs/original/3X/7/7/77359d2f0cd574dcebb3460b5a1c107790387b0d.png)

How to fix it?

---

<div class="post-metadata">

### Author: ![L00k](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.threejs.org/l00k/32/27900_2.png) [@L00k](https://discourse.threejs.org/u/L00k)
#### Post date: [August 2, 2022, 7:45pm UTC](https://discourse.threejs.org/t/incorrect-bounding-box-after-group-rotation-with-an-object/38930/2 "2022-08-02T19:45:07Z")

</div>

Hi @womas,

The Box3 is an axis-aligned bounding box (AABB). So when rotating the mesh the bounding box ‘grows’ because it calculates the min and max coordinates. It’s not possible to rotate an AABB but you could use OBB to allow rotations.

This video shows the differences:  
[https://youtu.be/HYO5Pthe3TE](https://youtu.be/HYO5Pthe3TE)

Hope this helps,

---

<div class="post-metadata">

### Author: ![womas](https://avatars.discourse-cdn.com/v4/letter/w/34f0e0/32.png) [@womas](https://discourse.threejs.org/u/womas)
#### Post date: [August 2, 2022, 8:33pm UTC](https://discourse.threejs.org/t/incorrect-bounding-box-after-group-rotation-with-an-object/38930/3 "2022-08-02T20:33:45Z")

</div>

Thanks, this explains the situation. That is, `THREE.Box3().setFromObject(sphere)` takes into account not the real position of the vertices in space, but some bounding cube around them?

---

<div class="post-metadata">

### Author: ![L00k](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.threejs.org/l00k/32/27900_2.png) [@L00k](https://discourse.threejs.org/u/L00k)
#### Post date: [August 9, 2022, 11:08am UTC](https://discourse.threejs.org/t/incorrect-bounding-box-after-group-rotation-with-an-object/38930/4 "2022-08-09T11:08:49Z")

</div>

Yes exactly!

---

<div class="post-metadata">

### Author: ![rrrr\_rrrr](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.threejs.org/rrrr_rrrr/32/7697_2.png) [@rrrr\_rrrr](https://discourse.threejs.org/u/rrrr_rrrr)
#### Post date: [August 9, 2022, 2:22pm UTC](https://discourse.threejs.org/t/incorrect-bounding-box-after-group-rotation-with-an-object/38930/5 "2022-08-09T14:22:28Z")

</div>

> [@L00k](#):
>
> The Box3 is an axis-aligned bounding box (AABB). So when rotating the mesh the bounding box ‘grows’

The **Mesh Of Interest** is a sphere, no growing or shrinking for this dude!
