Normal vector

From DmWiki

A normal vector is a vector that is perpendicular (i.e. points straight up out of a surface at a 90-degree angle) to something, such as a triangle or other surface. Normal vectors are very important for lighting calculations, as well as many other special effects, and for physics calculations. You can calculate the normal of a flat surface by taking any three points on the surface (for a triangle, these could be its three vertices) and then compute:

edge1 = point2 – point1
edge2 = point3 – point1
normal = edge1 × edge2 (where × is the cross product)

So in summary, you get the two edges that are formed by the three points, and take their cross rpdouct. The resulting vector will be the normal vector that is perpendicular to the surface that is formed by the three points.


DevMaster navigation