What Is The Correct Way To Invert A Triangle Face?

Hello :slight_smile:

Absolutely, I would just add “as per seen from the camera view angle”. (I mean that the clockwise/counterclockwise is computed in 2D).


Theorically, you would not need to fix these manually (By manually, I mean switching the indexing from p1,p2,p3 to p3,p2,p1 or whatever). A mesh, whatever the number of faces, should have a consistent orientation from a face to another. For example in Blender, when you “recalculate normals”, they are all computed again (either inside or outside) and then the wrapping index will be consistent from a face to another, at export time.

Now, back to BabylonJS, when for some reason the indexing is reversed, (for example have a look HERE) either you can change the direction on all the scene, either you can just change it for a specific material :

material.sideOrientation = 0; // clockwise
material.sideOrientation = 1; // counterclockwise

I agree that those orders should be considered as the same direction, though :thinking:

1 Like