[name]
A geometric triangle as defined by three [page:Vector3 Vector3s] representing its
three corners.
Constructor
[name]( [page:Vector3 a], [page:Vector3 b], [page:Vector3 c] )
[page:Vector3 a] - the first corner of the triangle. Default is a [page:Vector3] at (0, 0, 0).
[page:Vector3 b] - the second corner of the triangle. Default is a [page:Vector3] at (0, 0, 0).
[page:Vector3 c] - the final corner of the triangle. Default is a [page:Vector3] at (0, 0, 0).
Creates a new [name].
Properties
[property:Vector3 a]
The first corner of the triangle. Default is a [page:Vector3] at (0, 0, 0).
[property:Vector3 b]
The second corner of the triangle. Default is a [page:Vector3] at (0, 0, 0).
[property:Vector3 c]
the final corner of the triangle. Default is a [page:Vector3] at (0, 0, 0)
Methods
[method:Float area]()
Return the area of the triangle.
[method:Vector3 barycoordFromPoint]( [page:Vector3 point], [page:Vector3 optionalTarget] )
[page:Vector3 point] - [page:Vector3]
[page:Vector3 optionalTarget] - (optional) if specified, the result will be copied into this [page:Vector3], otherwise a new [page:Vector3] will be created.
Return a [link:https://en.wikipedia.org/wiki/Barycentric_coordinate_system barycentric coordinate]
from the given vector.
[link:http://commons.wikimedia.org/wiki/File:Barycentric_coordinates_1.png Picture of barycentric coordinates]
[method:Triangle clone]()
Returns a new triangle with the same [page:.a a], [page:.b b] and [page:.c c] properties as this one.
[method:Vector3 closestPointToPoint]( [page:Vector3 point], [page:Vector3 optionalTarget] )
point - [page:Vector3]
[page:Vector3 optionalTarget] - (optional) if specified, the result will be copied into this [page:Vector3], otherwise a new [page:Vector3] will be created.
Returns the closest point on the triangle to [page:Vector3 point].
[method:Boolean containsPoint]( [page:Vector3 point] )
[page:Vector3 point] - [page:Vector3] to check.
Returns true if the passed vector is within the triangle.
[method:Triangle copy]( [page:Triangle triangle] )
Copies the values of the passed triangles's [page:.a a], [page:.b b] and [page:.c c]
properties to this triangle.
[method:Boolean equals]( [page:Triangle triangle] )
Returns true if the two triangles have identical [page:.a a], [page:.b b] and [page:.c c] properties.
[method:Vector3 midpoint]( [page:Vector3 optionalTarget] )
[page:Vector3 optionalTarget] - (optional) if specified, the result will be copied into this [page:Vector3], otherwise a new [page:Vector3] will be created.
Calculate the midpoint of the triangle.
[method:Vector3 normal]( [page:Vector3 optionalTarget] )
[page:Vector3 optionalTarget] - (optional) if specified, the result will be copied into this [page:Vector3], otherwise a new [page:Vector3] will be created.
Calculate the [link:https://en.wikipedia.org/wiki/Normal_(geometry) normal vector] of the triangle.
[method:Plane plane]( [page:Plane optionalTarget] )
[page:Plane optionalTarget] - (optional) if specified, the result will be copied into this [page:Plane], otherwise a new [page:Plane] will be created.
Create a [page:Plane plane] based on the triangle. .
[method:Triangle set]( [page:Vector3 a], [page:Vector3 b], [page:Vector3 c] ) [page:Triangle this]
Sets the triangle's [page:.a a], [page:.b b] and [page:.c c] properties to the passed [page:vector3 vector3s].
[method:Triangle 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.
Source
[link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]