# What are mesh.flipFaces(), flipNormals & sideOrientation?

**URL:** <https://forum.babylonjs.com/t/what-are-mesh-flipfaces-flipnormals-sideorientation/44146>\
**Category:** Questions\
**Created:** [September 15, 2023, 4:39am UTC](https://forum.babylonjs.com/t/what-are-mesh-flipfaces-flipnormals-sideorientation/44146 "2023-09-15T04:39:36Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![tawibox](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/tawibox/32/22881_2.png) [@tawibox](https://forum.babylonjs.com/u/tawibox)\
**Post date:** [September 15, 2023, 4:39am UTC](https://forum.babylonjs.com/t/what-are-mesh-flipfaces-flipnormals-sideorientation/44146/1 "2023-09-15T04:39:36Z")

</div>

Hey folks,

Just generally feel confused among these 3 concepts.

Before I thought flip faces = flip normals. But in mesh API doc, under `Mesh.flipFaces()` , it takes `flipNormals` as an argument…So it makes feel “flip faces” and “flip normals” are 2 difference things…can anyone help understanding this?

Also, I ran into some other concepts on materials. `Material.sideOrientation = BABYLON.Material.ClockWiseSideOrientation;` is one of them. I know `sideOrientation` means deciding which side of the face is front and which is back. But what does “ClockWiseSideOrientation” and “CounterClockWiseSideOrientation” mean the other hand? I feel this property is somehow related to flip faces and normals but not really sure…can someone help too?

Also here are some other concepts confuses me too:

- twoSidedLighting
- DOUBLESIDE / FRONTSIDE / BACKSIDE ← I know their definitions but just trying to understand their relation to other above concepts…

These are related topics I have found:

- [DOUBLESIDE vs. backFaceCulling](https://forum.babylonjs.com/t/doubleside-vs-backfaceculling/25247)
- [Mesh Clone then Flip Normals](https://forum.babylonjs.com/t/mesh-clone-then-flip-normals/1988)
- [separateCullingPass knocks out twoSidedLighting](https://forum.babylonjs.com/t/separatecullingpass-knocks-out-twosidedlighting/14615)
- [Inverting normals numerically](https://forum.babylonjs.com/t/inverting-normals-numerically/17762)

Many thanks,  
Tawibox

---

<div class="post-metadata">

**Author:** ![carolhmj](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/carolhmj/32/25918_2.png) [@carolhmj](https://forum.babylonjs.com/u/carolhmj)\
**Post date:** [September 15, 2023, 11:10am UTC](https://forum.babylonjs.com/t/what-are-mesh-flipfaces-flipnormals-sideorientation/44146/2 "2023-09-15T11:10:17Z")

</div>

Hello!

About clock and counter clockwise, they are always referenced to the hand coordinate system you’re using:

![image](https://us1.discourse-cdn.com/flex024/uploads/babylonjs/original/3X/6/f/6fa0e3f083b2c5373d4b0a5ff481f440083364c5.png)

If you align the thumb of your hand with the normal of a face and rotate your hand, you’ll see if the vertices are clockwise or counter clockwise:

![image](https://us1.discourse-cdn.com/flex024/uploads/babylonjs/original/3X/0/9/09bab1524e5b1809915945ffa64a161283c65cd6.png)

This video offers a nice explanation about it: [(3) [Episode 15] Rendering a Quad (And Understanding Winding Order) - Modern OpenGL - YouTube](https://www.youtube.com/watch?v=QjmPjT-Iheg)

Just remember that for the video, it uses OpenGL coordinate system which is right handed, while Babylon is left handed by default.

I think the video will do a better explanation than me to explain why flipFaces and flipNormals are different. Flip faces will flip the _winding order_ (which is the clockwise and counterclockwise thing), while flip normals just reverses the direction of the normal. You can see it on the code here: [https://github.com/BabylonJS/Babylon.js/blob/41cb891508d8f008f97e85e206a155a97d296e9f/packages/dev/core/src/Meshes/mesh.ts#L3154](https://github.com/BabylonJS/Babylon.js/blob/41cb891508d8f008f97e85e206a155a97d296e9f/packages/dev/core/src/Meshes/mesh.ts#L3154)

---

<div class="post-metadata">

**Author:** ![tawibox](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/tawibox/32/22881_2.png) [@tawibox](https://forum.babylonjs.com/u/tawibox)\
**Post date:** [September 15, 2023, 9:30pm UTC](https://forum.babylonjs.com/t/what-are-mesh-flipfaces-flipnormals-sideorientation/44146/3 "2023-09-15T21:30:57Z")

</div>

@carolhmj Thank you so much for the response! Yeah this is great! Will read them through!!

Many thanks again!!
