forked from mrdoob/three.js
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTriangle.html
More file actions
155 lines (126 loc) · 3.83 KB
/
Triangle.html
File metadata and controls
155 lines (126 loc) · 3.83 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<base href="../../" />
<script src="list.js"></script>
<script src="page.js"></script>
<link type="text/css" rel="stylesheet" href="page.css" />
</head>
<body>
<h1>[name]</h1>
<div class="desc">A geometric triangle as defined by three vectors.</div>
<h2>Constructor</h2>
<h3>[name]( [page:Vector3 a], [page:Vector3 b], [page:Vector3 c] )</h3>
<div>
a -- [page:Vector3] <br />
b -- [page:Vector3] <br />
c -- [page:Vector3]
</div>
<div>
Sets the triangle's vectors to the passed vectors.
</div>
<h2>Properties</h2>
<h3>[property:Vector3 a]</h3>
<div>
The first [page:Vector3] of the triangle.
</div>
<h3>[property:Vector3 b]</h3>
<div>
The second [page:Vector3] of the triangle.
</div>
<h3>[property:Vector3 c]</h3>
<div>
The third [page:Vector3] of the triangle.
</div>
<h2>Methods</h2>
<h3>[method:Triangle setFromPointsAndIndices]( [page:Array points], [page:Integer i0], [page:Integer i1], [page:Integer i2] ) [page:Triangle this]</h3>
<div>
points -- [page:Array] of [page:Vector3]s <br />
i0 -- [page:Integer] index <br />
i1 -- [page:Integer] index <br />
i2 -- [page:Integer] index
</div>
<div>
Sets the triangle's vectors to the vectors in the array.
</div>
<h3>[method:Triangle set]( [page:Vector3 a], [page:Vector3 b], [page:Vector3 c] ) [page:Triangle this]</h3>
<div>
a -- [page:Vector3] <br />
b -- [page:Vector3] <br />
c -- [page:Vector3]
</div>
<div>
Sets the triangle's vectors to the passed vectors.
</div>
<h3>[method:Vector3 normal]( [page:Vector3 optionalTarget] )</h3>
<div>
optionalTarget -- Optional [page:Vector3] target to set the result.
</div>
<div>
Return the calculated normal of the triangle.
</div>
<h3>[method:Vector3 barycoordFromPoint]( [page:Vector3 point], [page:Vector3 optionalTarget] )</h3>
<div>
point -- [page:Vector3] <br />
optionalTarget -- Optional [page:Vector3] target to set the result.
</div>
<div>
Return a barycentric coordinate from the given vector. <br/><br/>
[link:http://commons.wikimedia.org/wiki/File:Barycentric_coordinates_1.png](Picture of barycentric coordinates)
</div>
<h3>[method:Triangle clone]()</h3>
<div>
Return a new copy of this triangle.
</div>
<h3>[method:Float area]()</h3>
<div>
Return the area of the triangle.
</div>
<h3>[method:Vector3 midpoint]( [page:Vector3 optionalTarget] )</h3>
<div>
optionalTarget -- Optional [page:Vector3] target to set the result.
</div>
<div>
Return the midpoint of the triangle. Optionally sets a target vector.
</div>
<h3>[method:Boolean equals]( [page:Triangle triangle] )</h3>
<div>
triangle -- [page:Triangle]
</div>
<div>
Checks to see if two triangles are equal (share the same vectors).
</div>
<h3>[method:Plane plane]( [page:Plane optionalTarget] )</h3>
<div>
optionalTarget -- Optional [page:Plane] target to set the result.
</div>
<div>
Return a [page:Plane plane] based on the triangle. Optionally sets a target plane.
</div>
<h3>[method:Boolean containsPoint]( [page:Vector3 point] )</h3>
<div>
point -- [page:Vector3]
</div>
<div>
Checks to see if the passed vector is within the triangle.
</div>
<h3>[method:Vector3 closestPointToPoint]( [page:Vector3 point], [page:Vector3 optionalTarget] )</h3>
<div>
point -- [page:Vector3] <br />
optionalTarget -- Optional [page:Vector3] target to set the result.
</div>
<div>
Returns the closest point on the triangle.
</div>
<h3>[method:Triangle copy]( [page:Triangle triangle] )</h3>
<div>
triangle -- [page:Triangle]
</div>
<div>
Copies the values of the vertices of the passed triangle to this triangle.
</div>
<h2>Source</h2>
[link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]
</body>
</html>