[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

[property:Vector3 a]

The first [page:Vector3] of the triangle.

[property:Vector3 b]

The second [page:Vector3] of the triangle.

[property:Vector3 c]

The third [page:Vector3] of the triangle.

Methods

[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.

[method:Triangle 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.

[method:Vector3 normal]( [page:Vector3 optionalTarget] )

optionalTarget -- Optional [page:Vector3] target to set the result.
Return the calculated normal of the triangle.

[method:Vector3 barycoordFromPoint]( [page:Vector3 point], [page:Vector3 optionalTarget] )

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)

[method:Triangle clone]()

Return a new copy of this triangle.

[method:Float area]()

Return the area of the triangle.

[method:Vector3 midpoint]( [page:Vector3 optionalTarget] )

optionalTarget -- Optional [page:Vector3] target to set the result.
Return the midpoint of the triangle. Optionally sets a target vector.

[method:Boolean equals]( [page:Triangle triangle] )

triangle -- [page:Triangle]
Checks to see if two triangles are equal (share the same vectors).

[method:Plane plane]( [page:Plane optionalTarget] )

optionalTarget -- Optional [page:Plane] target to set the result.
Return a [page:Plane plane] based on the triangle. Optionally sets a target plane.

[method:Boolean containsPoint]( [page:Vector3 point] )

point -- [page:Vector3]
Checks to see if the passed vector is within the triangle.

[method:Vector3 closestPointToPoint]( [page:Vector3 point], [page:Vector3 optionalTarget] )

point -- [page:Vector3]
optionalTarget -- Optional [page:Vector3] target to set the result.
Returns the closest point on the triangle.

[method:Triangle copy]( [page:Triangle 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]