polygon_z_normal(3)

NAME
polygon_z_normal, polygon_z_normal_f

SYNOPSIS
#include <allegro.h>

fixed polygon_z_normal(const V3D *v1, *v2, *v3); float polygon_z_normal_f(const V3D_f *v1, *v2, *v3);

DESCRIPTION
Finds the Z component of the normal vector to the specified three vertices (which must be part of a convex polygon). This is used mainly in back-face culling. The back-faces of closed polyhedra are never visible to the viewer, therefore they never need to be drawn. This can cull on average half the polygons from a scene. If the normal is negative the polygon can safely be culled. If it is zero, the polygon is perpendicular to the screen.

SEE ALSO
cross_product(3)