Finding the sides of a mesh loaded using Asset Manager

I have a mesh that is loaded using Asset Manager and I am viewing this mesh in orthographic camera mode. I have identified the vertices of this mesh using bounding info and bounding box property. Now my next challenge is to identity the sides of the mesh. like top, right, left and bottom and these values do not change when the mesh is rotated. For example when the mesh is at 0 rotation the side assigned as top of the mesh should be always the top even when the mesh is rotated.

Any help in this issue would be encouraged and appreciated. :slight_smile:

Thanks.

You probably want to check the orientation of the normals of each triangle to know where this triangle is located.

You can get the normals of each vertex by calling mesh.getVerticesData("normal").

To get the triangles you need to call mesh.getIndices():

https://playground.babylonjs.com/#L8FUSC

If you apply some transformations to your mesh, however, you will need to transform the normals accordingly as the ones you get from mesh.getVerticesData("normal") won’t change with the transformation.