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