Custom mesh's boundingBox

I created a custom mesh,but the boundingbox is wrong.

Do I need to manually calculate based on vertex properties?

You may do it with reConstruct() function.
Example (with arbitrary values) - https://playground.babylonjs.com/#VKBJN#3428

image

The bounding info is created based on the full vertex positions array but it looks like at least 2/3 of your positions are unused and shouldn’t be affecting the bounding box. E.G. you can loop over the indices to calculate min and max based on the positions that are in use to get the correct values to reconstruct the bounding info with like on lines 41-47. :slight_smile:

5 Likes