[name]
A geometric triangle as defined by three vectors.
Constructor
[name]([page:Vector3 a], [page:Vector3 b], [page:Vector3 c])
a -- [page:Vector3]
b -- [page:Vector3]
c -- [page:Vector3]
Sets the triangle's vectors to the passed vectors.
Properties
.[page:Vector3 a]
The first [page:Vector3] of the triangle.
.[page:Vector3 c]
The second [page:Vector3] of the triangle.
.[page:Vector3 b]
The third [page:Vector3] of the triangle.
Methods
.setFromPointsAndIndices([page:Array points], [page:Integer i0], [page:Integer i1], [page:Integer i2]) [page:Triangle this]
points -- [page:Array] of [page:Vector3]s
i0 -- [page:Integer] index
i1 -- [page:Integer] index
i2 -- [page:Integer] index
Sets the triangle's vectors to the vectors in the array.
.set([page:Vector3 a], [page:Vector3 b], [page:Vector3 c]) [page:Triangle this]
a -- [page:Vector3]
b -- [page:Vector3]
c -- [page:Vector3]
Sets the triangle's vectors to the passed vectors.
.normal([page:Vector3 optionalTarget]) [page:Vector3]
optionalTarget -- Optional [page:Vector3] target to set the result.
Return the calculated normal of the triangle.
.barycoordFromPoint([page:Vector3 point], [page:Vector3 optionalTarget]) [page:Vector3]
point -- [page:Vector3]
optionalTarget -- Optional [page:Vector3] target to set the result.
Return a barycentric coordinate from the given vector.
[link:http://commons.wikimedia.org/wiki/File:Barycentric_coordinates_1.png](Picture of barycentric coordinates)
.clone() [page:Triangle]
Return a new copy of this triangle.
.area() [page:Float]
Return the area of the triangle.
.midpoint([page:Vector3 optionalTarget]) [page:Vector3]
optionalTarget -- Optional [page:Vector3] target to set the result.
Return the midpoint of the triangle. Optionally sets a target vector.
.equals([page:Triangle triangle]) [page:Boolean]
triangle -- [page:Triangle]
Checks to see if two triangles are equal (share the same vectors).
.plane([page:Plane optionalTarget]) [page:Plane]
optionalTarget -- Optional [page:Plane] target to set the result.
Return a [page:Plane plane] based on the triangle. Optionally sets a target plane.
.containsPoint([page:Vector3 point]) [page:Boolean]
point -- [page:Vector3]
Checks to see if the passed vector is within the triangle.
.copy([page:Triangle triangle]) [page:Triangle]
triangle -- [page:Triangle]
Copies the values of the vertices of the passed triangle to this triangle.
Source
[link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]