From 568ad320bc32eeb2de60505b0fba6e0f7f738983 Mon Sep 17 00:00:00 2001 From: Brandon Poythress Date: Sat, 19 May 2018 15:29:26 -0400 Subject: [PATCH] working on intersection --- Triangle.js | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/Triangle.js b/Triangle.js index af61fc7..63ed9c0 100644 --- a/Triangle.js +++ b/Triangle.js @@ -1,3 +1,14 @@ -function Triangle(point1, point2, point3){ - + +//basic triangular building block. takes in +//vector3 objects as the vertices +function Triangle(point1In, point2In, point3In){ + this.point1 = point1In; + this.point2 = point2In; + this.point3 = point3In; + + this.uVector = vector3Subtract(point2In, point1In); + this.vVector = vector3Subtract(point3In, point1In); + + this.normalVector = vector3CrossProduct(uVector, vVector).normalize(); + } \ No newline at end of file