Surface Normal
- Surface normal plays a key role in computer graphics.
- Given a triangle <, , >, let denote the vector connecting the first vertex () and the second (). Similarly, the vector connecting the first vertex () and the third () is denoted by (). Then, the triangle normal is computed using the cross product based on the right-hand rule.
where denotes the cross product operation.
- When and are represented in () and (), respectively, is defined as
- Every normal vector is made to be a unit vector by default.
- Note that , , and are ordered counter-clockwise (CCW).
- Vertex normal should approximate the normal of the smooth surface at the vertex position.
- A vertex normal is usually computed by averaging the normals of all polygons sharing the vertex.
- In computer graphics, surface normals are supposed to point out of the polyhedron. For this, we need CCW ordering of the vertices, i.e, <, , >, instead of <, , >
- In the index buffer, the vertices are ordered CCW.
