Can you invert the face normals of a figure?

So in my project I’ve been generating shapes via for loops, some of them generate the shape in a correct way and some doesn’t, so I want to know if there is any way to force Babylon.JS to calculate everytime the normals to the outside?

I wish I could give a playground but this time the shape is being generated from a json file and the playground didn’t let me put a tunnel to call that json.

This is the shape in question (ignore the lines), some of the shapes are with the correct normals but others are with inverted normals.

if is needed I can send code scripplets of the loop.

You could just copy and paste the json into the PG


You can check VertexData.ComputeNormals: Create Custom Meshes From Scratch | Babylon.js Documentation (

Keep in mind that, for the normals to be correctly computed, the faces should be specified in the correct orientation: Counterclockwise in a Left Handed System.

1 Like
Look at lines 392-410. I have used this previously to determine winding order when using 2D clipping libraries supporting holes etc.


Finally! thanks for the answer it really helped me a lot with the normals issue!