Shader Learn

06 Space, camera and depth

Back-face culling: triangles have two sides

A tube open at both ends. Can you see its inner wall from outside?

Explanation

Drag the underlined numbers left and right

const geometry = new THREE.CylinderGeometry(  0.9, 0.9, 1.6, 32, 1, true // open at both ends);material.side = THREE.;// reverse vertex order: 
0120 → 1 → 2 counter-clockwise: the front faces you
CullingSeen from the camera, a triangle whose vertices run counter-clockwise is front-facing. Three.js defaults to side = FrontSide.

Triangles have a front and a back: seen from the front, the vertices run counter-clockwise. By default only fronts are drawn; backs are culled.

Try it

  • Switch to BackSide: only the inner wall is left
  • Turn on “Reverse vertex order”: front and back swap