So I wanna show bounding box for my models I am importing, since root mesh doesn’t have bounding info by default, I am calculating manually. issue is box seem to have correct min and max (basically size) and even centerWorld seems to be correct but it is being rendered with some offset on x axis for every model. I tried creating box mesh with size I am calculatinf for bouding box and also center as position for it. And box seems to be be highting correct.
Can you share a Playground with your code?
Here it is, Initially you’ll see correct bounding box but try clicking on mesh and change its position using gizmo.
The issue looks like it’s caused by rootNode’s scaling determinant.
You can choose to create a new mesh as the rootNode.
It doesn’t break the original transform of the model, it just adds an empty mesh node.
Of course this is just a bypass issue, and I still wonder why boundingBox rendering is affected by determinant imagery errors.
bounding box issue | Babylon.js Playground (babylonjs.com)
it still breaks in some use cases where I am transforming whole glb using root node (which new empty mesh here).
bounding box issue | Babylon.js Playground (babylonjs.com)
Try not to associate parent-child relationships, and only create an empty mesh for displaying boundingBox.
If the result is still incorrect, check the GLB model for bones and morph.