Make model fits into a box

Yes I translate the position of every mesh in the model so that there are all correctly centered.
You say you need to load hundreds of model?
What would be the issue to do it “manually” for hundreds of model? If you code it once, it will work fine with a thousand of models :wink:

Hum what you expose seems more like a collision issue than a boundingbox issue. You can easily use scene.pick function to find the model clicked.
I advise you to create a new question on the forum to have the correct answer to your issue.

Cheerz :wink:

Yes, so I need to add bounding boxes to each model, but I don’t know how to do that

Your location is self-defined, if there are hundreds of models, I can’t manually define the location for him, that would be too troublesome

So what I need to know is how do I add a bounding box to each model without having to position it

1 Like

I don’t see why you need a boundingBox for collision as you would be more precise by picking the model itself (You just would have to check if the mesh picked belong to a model in your scene).
If you really want the boundingBox, you could show the boudingBox of the main parent of the model, BabylonJS always create a parent for every model imported which has the name _root_. Use showBoundingBox = true on that mesh and I guess it would work.

So how do I figure out which models are on top of the ones I’m currently selecting