My problem is they still share the same boundingInfo : the bounding box is unchanged and do not fit to the new dimension of each sub-mesh.
It is a problem because I need to get the position of each sub-mesh into the world space, but each sub-mesh is at position [0, 0, 0] and with a full bounding box.
Do you have any idea about how could I get the position of each submesh, or re-computing a bounding box to actual submesh vertex ?
The bounding box accurately reflects the numbers in your positions array.
I manually calculated the extend size from your positions arrays and it agrees with what’s reported in the bounding info and it’s the same for each submesh. Look at this playground with debugger on. Do you think there are some extraneous points in your mesh data?
Yes, bounding boxes refers to values into the positions array.
My mesh data does not contains extra data, it is correctly splitted.
The problem is during the assignment of new data inside each submesh, I guess I’m doing it wrong…
Look at the normals displayed on each submesh : https://playground.babylonjs.com/#ZIUHK6#6
It looks like the submesh still have information about the old full mesh, even if I start with an empty VertexData object…
I am using this snippet to deconstruct the mesh, maybe it is not the correct way to do : Deconstruct A Mesh | Babylon.js Documentation
I would think your indices array newI is all good as indices are ordered in the “parent” array but nothing guarantees it for N, P and U. you would need to manually pick the one referenced by their index and only those.
so your buffer might contain more info than needed which is not an issue for rendering.
You may have right, slicing these arrays is not giving me the correct answer.
So I tried to find back the corresponding values from indices.
I updated my playground : https://playground.babylonjs.com/#ZIUHK6#14
You can try to change the boolean value on top of the code
AUTO_FIND is true ==> previous version with correct drawing but incorrect bounding boxes
AUTO_FIND to false ==> new version with correct bounding boxes ?
In the second case, the bounding boxes seems to be approximatively correct.
Hovewer, as you can see, the model is not draw at all.
Maybe my entry .babylon model is corrupted ?
Do you think I am doing it the good way ?
I could try to change my model, thank you in advance