Assuming you need a normal vector for an ATV, this pseudo code works
Vector3d vertex[4] = { ... } Vector3d normal(0,0,0) ; for (int i=0; i<4; i++) { normal += cross (vertex[i], vertex[(i+1)%4]) ;
This gives the formula n=A/|A| , where A = v0xv1 + v1xv2 + v2xv3 + v3xv0 and vi=vertex[i] ). |A|/2 also the region of the polygon. This can be generalized to arbitrary polygons and even give reasonable results for non-planar polygons if they are not too flat.
One link http://softsurfer.com/Archive/algorithm_0101/algorithm_0101.htm
If you know that the square / polygon is flat, you only need to calculate the normal of the triangle formed by the first three vertices. This is A1/|A1| , where A1 = (v1-v0)x(v2-v0) = v0xv1 + v1xv2 + v2xv0 .
If using quad-normalization you mean something else, just ignore this answer.
EDIT: I found this related question: Get the surface area of a polyhedron (3D object)
source share