-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
03a532d
commit 568ad32
Showing
1 changed file
with
13 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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(); | ||
|
||
} |