If I create a very simple box like this :
let box = BABYLON.MeshBuilder.CreateBox("box", { height: 1, width: 1, depth: 1 }, this.scene);
box.position = new BABYLON.Vector3(0, 0, 0);
When I get the geometry I get a strange ‘Indices’ array. The array is 36 long. I was expecting 24 since I’m getting 72 positions/normals. ( 24 Vectors )
The Indices array is not ordered and I don’t understand why. At the end is a very basic box.
How can I order the Positions/Normals and create a 36 index ? I need ordered because I’m creating a UV mapping and with the index messed up it is tricky. I tried to insert a 24 array, but the view goes in crash with the error : glDrawElements: attempt to access out of range vertices in attribute 0
Another thing that I don’t understand is that if I get the facet positions the coordinates are different from the positions array. Why ?
TIA