Polygon points order make shape close or not

The order in wich the points for a polygon are determined seem to have affect on the closing of the shape. I’m kind of new to Babylon so sorry if this is as it should but it seemed odd to me.

I made a playground example:

Hello :slight_smile:

Yes, that’s absolutely normal. It’s called “Backface Culling”.
Basically, backface culling allows to get rid of certains faces at render, based on if they are facing the camera, or not. A very simple way of computing this is, having a look at a triangle seen from camera, check if the 3 points of the triangle turns clockwise, or counterclockwise. The default behavior is counterclock wise :

So to conclude, yes, when you build a mesh, order matters.
You can also disable backface culling if you want to render anyway whatever the side, but it will lower performances since even back faces will be rendered.

When you build the mesh, there is also a parameter "sideOrientation" for the BABYLON.MeshBuilder.CreatePolygon



Ah so the shape is closed but i’m looking at the back :slightly_smiling_face:

Tnx for the quick reply!