From b9db7fd9e2d9a875fc6cf0c43b223d0f53ba2fbf Mon Sep 17 00:00:00 2001 From: kovacsv Date: Wed, 16 Jun 2021 09:04:23 +0200 Subject: [PATCH] Use cross vector calculation when calculating triangle normal. --- source/model/modelutils.js | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/source/model/modelutils.js b/source/model/modelutils.js index c321a9b..c077589 100644 --- a/source/model/modelutils.js +++ b/source/model/modelutils.js @@ -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; };