Incorrect bounding box after group rotation with an object

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:

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

Image001638

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

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

Image001639

How to fix it?

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

Hope this helps,

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?

Yes exactly!

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