Updating bounding box issue

Hi all,

I create a bounding box using OBB (Oriented Bounding Box) and it works fine:

But when I update the box position and rotation to match my object’s position and rotation it shifts the bounding box:


What’s curious is that I happen to do the same 90° rotation around the Z axis in Blender before exporting the object.
In Blender, I select my object in “object mode”, I then press the “R” key, then the “Z” key, then press “90” to apply a 90° rotation and I export a compressed .glb file.

I reproduced the issue here: Bounding box issue - JSFiddle - Code Playground

Thanks for your help :blush:

To fix this issue, I simply had to apply the rotation to the object in Blender before exporting, so that its local coordinate system is reset.

Here are the steps in Blender:

  1. Select the object in Blender.
  2. Press Ctrl/Cmd + A to open the “Apply” menu.
  3. Choose “Rotation” from the menu. This will apply the rotation and reset the object’s local coordinate system.