Is the following a correct way of calculating the normal of a triangle surface?
1
|\
| \
| \
|___\
2 3
Local ax:Float = x2-x1
Local ay:Float = y2-y1
Local az:Float = z2-z1
Local bx:Float = x3-x1
Local by:Float = y3-y1
Local bz:Float = z3-z1
Local nx:Float = (ay*bz) - (az*by)
Local ny:Float = (az*bx) - (ax*bz)
Local nz:Float = (ax*by) - (ay*bx)
Local length:Float = Sqr(nx*nx + ny*ny + nz*nz)
nx :/ length
ny :/ length
nz :/ length
x1-x3, y1-y2, z1-z3 are the position vectors of the three points of the triangle. Nx,ny,nz are the final normals (hopefully).