Use cross vector calculation when calculating triangle normal.

This commit is contained in:
kovacsv 2021-06-16 09:04:23 +02:00
parent d35e4c8f2d
commit b9db7fd9e2

View File

@ -2,13 +2,7 @@ OV.CalculateTriangleNormal = function (v0, v1, v2)
{
let v = OV.SubCoord3D (v1, v0);
let w = OV.SubCoord3D (v2, v0);
let normal = new OV.Coord3D (
v.y * w.z - v.z * w.y,
v.z * w.x - v.x * w.z,
v.x * w.y - v.y * w.x
);
let normal = OV.CrossVector3D (v, w);
normal.Normalize ();
return normal;
};