logo
Free, unlimited AI code reviews that run on commit
git-lrc git-lrc GitHub Install Now We'd appreciate a star git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt

polygon_z_normal, polygon_z_normal_f - Finds the Z component of the normal vector to three vertices.

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.

       However, this method of culling back-faces must only be used once the  X  and  Y  coordinates  have  been
       projected  into screen space using persp_project() (or if an orthographic (isometric) projection is being
       used). Note that this function will fail if the three vertices are co-linear (they lie on the same  line)
       in 3D space.

Name

       polygon_z_normal,  polygon_z_normal_f  -  Finds  the  Z component of the normal vector to three vertices.
       Allegro game programming library.

See Also

cross_product(3alleg4), ex3d(3alleg4)

Allegro                                           version 4.4.3                        polygon_z_normal(3alleg4)

Synopsis

#include<allegro.h>fixedpolygon_z_normal(constV3D*v1,constV3D*v2,constV3D*v3);floatpolygon_z_normal_f(constV3D_f*v1,constV3D_f*v2,constV3D_f*v3);

See Also