Skip to content

Commit 62f3060

Browse files
committed
Add Utah teapot as a geometry object; doc cleanup
Add the Utah teapot geometry object, along with a demo showing its options. Also fix Matrix* documentation: match current constructor code, and clean up style.
1 parent ef67cef commit 62f3060

File tree

5 files changed

+1048
-47
lines changed

5 files changed

+1048
-47
lines changed

docs/api/math/Matrix3.html

Lines changed: 19 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -16,26 +16,9 @@ <h1>[name]</h1>
1616
<h2>Constructor</h2>
1717

1818

19-
<h3>[name]([page:Float n11], [page:Float n12], [page:Float n13], [page:Float n21], [page:Float n22], [page:Float n23], [page:Float n31], [page:Float n32], [page:Float n33])</h3>
19+
<h3>[name]()</h3>
2020
<div>
21-
n11 -- [page:Float] <br />
22-
n12 -- [page:Float] <br />
23-
n13 -- [page:Float] <br />
24-
n21 -- [page:Float] <br />
25-
n22 -- [page:Float] <br />
26-
n23 -- [page:Float] <br />
27-
n31 -- [page:Float] <br />
28-
n32 -- [page:Float] <br />
29-
n33 -- [page:Float]
30-
</div>
31-
<div>
32-
Initialize the 3x3 matrix with a row-major sequence of values.<br/><br/>
33-
34-
n11, n12, n13,<br/>
35-
n21, n22, n23,<br/>
36-
n31, n32, n33<br/><br/>
37-
38-
If no values are sent the matrix will be initialized as an identity matrix.
21+
Creates and initializes the 3x3 matrix to the identity matrix.
3922
</div>
4023

4124

@@ -44,7 +27,7 @@ <h2>Properties</h2>
4427

4528
<h3>[property:Float32Array elements]</h3>
4629
<div>
47-
Float32Array with column-major matrix values.
30+
A column-major list of matrix values.
4831
</div>
4932

5033

@@ -60,13 +43,13 @@ <h3>[method:Matrix3 transposeIntoArray]( [page:Array array] )</h3>
6043
array -- [page:Array] <br />
6144
</div>
6245
<div>
63-
Transposes this matrix into the supplied array, and returns itself.
46+
Transposes this matrix into the supplied array, and returns itself unchanged.
6447
</div>
6548

6649

6750
<h3>[method:Float determinant]()</h3>
6851
<div>
69-
Returns the matrix's determinant.
52+
Computes and returns the determinant of this matrix.
7053
</div>
7154

7255
<h3>[method:Matrix3 set]([page:Float n11], [page:Float n12], [page:Float n13], [page:Float n21], [page:Float n22], [page:Float n23], [page:Float n31], [page:Float n32], [page:Float n33]) [page:Matrix3 this]</h3>
@@ -82,58 +65,58 @@ <h3>[method:Matrix3 set]([page:Float n11], [page:Float n12], [page:Float n13], [
8265
n33 -- [page:Float]
8366
</div>
8467
<div>
85-
Set the 3x3 matrix values to the given row-major sequence of values.
68+
Sets the 3x3 matrix values to the given row-major sequence of values.
8669
</div>
8770

88-
<h3>[method:Matrix3 multiplyScalar]([page:Float scalar]) [page:Matrix3 this]</h3>
71+
<h3>[method:Matrix3 multiplyScalar]([page:Float s]) [page:Matrix3 this]</h3>
8972
<div>
9073
scalar -- [page:Float]
9174
</div>
9275
<div>
93-
Multiply every component of the matrix by a scalar value.
76+
Multiplies every component of the matrix by the scalar value *s*.
9477
</div>
9578

9679
<h3>[method:Array applyToVector3Array]([page:Array array])</h3>
9780
<div>
9881
array -- An array in the form [vector1x, vector1y, vector1z, vector2x, vector2y, vector2z, ...]
9982
</div>
10083
<div>
101-
Multiply (apply) this matrix to every vector3 in the array.
84+
Multiplies (applies) this matrix to every vector3 in the array.
10285
</div>
10386

104-
<h3>[method:Matrix3 getNormalMatrix]([page:Matrix4 matrix4]) [page:Matrix3 this]</h3>
87+
<h3>[method:Matrix3 getNormalMatrix]([page:Matrix4 m]) [page:Matrix3 this]</h3>
10588
<div>
106-
matrix4 -- [page:Matrix4]
89+
m -- [page:Matrix4]
10790
</div>
10891
<div>
109-
Set this matrix as the normal matrix of the passed [page:Matrix4 matrix4]. The normal matrix is the inverse transpose of the matrix.
92+
Sets this matrix as the normal matrix (upper left 3x3)of the passed [page:Matrix4 matrix4]. The normal matrix is the inverse transpose of the matrix *m*.
11093
</div>
11194

112-
<h3>[method:Matrix3 getInverse]([page:Matrix4 matrix4], [page:Boolean throwOnInvertible]) [page:Matrix3 this]</h3>
95+
<h3>[method:Matrix3 getInverse]([page:Matrix4 m], [page:Boolean throwOnInvertible]) [page:Matrix3 this]</h3>
11396
<div>
114-
matrix4 -- [page:Matrix4] <br />
97+
m -- [page:Matrix4]<br />
11598
throwOnInvertible -- [Page:Boolean] If true, throw an error if the matrix is invertible.
11699
</div>
117100
<div>
118101
Set this matrix to the inverse of the passed matrix.
119102
</div>
120103

121-
<h3>[method:Matrix3 copy]([page:Matrix3 matrix]) [page:Matrix3 this]</h3>
104+
<h3>[method:Matrix3 copy]([page:Matrix3 m]) [page:Matrix3 this]</h3>
122105
<div>
123-
matrix -- [page:Matrix3]
106+
m -- [page:Matrix4]
124107
</div>
125108
<div>
126-
Copy the values of the passed matrix.
109+
Copies the values of matrix *m* into this matrix.
127110
</div>
128111

129112
<h3>[method:Matrix3 clone]()</h3>
130113
<div>
131-
Create a copy of the matrix.
114+
Creates a copy of this matrix.
132115
</div>
133116

134117
<h3>[method:Matrix3 identity]() [page:Matrix3 this]</h3>
135118
<div>
136-
Set as an identity matrix.<br/><br/>
119+
Resets this matrix to identity.<br/><br/>
137120

138121
1, 0, 0<br/>
139122
0, 1, 0<br/>

docs/api/math/Matrix4.html

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -39,10 +39,10 @@ <h2>Example</h2>
3939
<h2>Constructor</h2>
4040

4141

42-
<h3>[name]( [page:Float n11], [page:Float n12], [page:Float n13], [page:Float n14], [page:Float n21], [page:Float n22], [page:Float n23], [page:Float n24], [page:Float n31], [page:Float n32], [page:Float n33], [page:Float n34], [page:Float n41], [page:Float n42], [page:Float n43], [page:Float n44] )</h3>
42+
<h3>[name]()</h3>
4343

4444
<div>
45-
Initialises the matrix with the supplied row-major values n11..n44, or just creates an identity matrix if no values are passed.
45+
Creates and initializes the matrix to the identity matrix.
4646
</div>
4747

4848
<h2>Properties</h2>
@@ -64,20 +64,20 @@ <h3>[method:Matrix4 identity]() [page:Matrix4 this]</h3>
6464

6565
<h3>[method:Matrix4 copy]( [page:Matrix4 m] ) [page:Matrix4 this]</h3>
6666
<div>
67-
Copies a matrix *m* into this matrix.
67+
Copies the values of matrix *m* into this matrix.
6868
</div>
6969

7070
<h3>[method:Matrix4 copyPosition]( [page:Matrix4 m] ) [page:Matrix4 this]</h3>
7171
<div>
7272
Copies the translation component of the supplied matrix *m* into this matrix translation component.
7373
</div>
7474

75-
<h3>[method:Matrix4 makeBasis]( [page:Vector3 xAxis], [page:Vector3 yAxis], [page:Vector3 zAxis] ) [page:Matrix4 this]</h3>
75+
<h3>[method:Matrix4 makeBasis]( [page:Vector3 xAxis], [page:Vector3 zAxis], [page:Vector3 zAxis] ) [page:Matrix4 this]</h3>
7676
<div>
7777
Creates the basis matrix consisting of the three provided axis vectors. Returns the current matrix.
7878
</div>
7979

80-
<h3>[method:Matrix4 extractBasis]( [page:Vector3 xAxis], [page:Vector3 yAxis], [page:Vector3 zAxis] ) [page:Matrix4 this]</h3>
80+
<h3>[method:Matrix4 extractBasis]( [page:Vector3 xAxis], [page:Vector3 zAxis], [page:Vector3 zAxis] ) [page:Matrix4 this]</h3>
8181
<div>
8282
Extracts basis of into the three axis vectors provided. Returns the current matrix.
8383
</div>
@@ -110,12 +110,12 @@ <h3>[method:Matrix4 multiplyToArray]( [page:Matrix4 a], [page:Matrix4 b], [page:
110110

111111
<h3>[method:Matrix4 multiplyScalar]( [page:Float s] ) [page:Matrix4 this]</h3>
112112
<div>
113-
Multiplies this matrix by *s*.
113+
Multiplies every component of the matrix by a scalar value *s*.
114114
</div>
115115

116116
<h3>[method:Float determinant]()</h3>
117117
<div>
118-
Computes determinant of this matrix.<br />
118+
Computes and returns the determinant of this matrix.<br />
119119
Based on [link:http://www.euclideanspace.com/maths/algebra/matrix/functions/inverse/fourD/index.htm]
120120
</div>
121121

@@ -142,7 +142,7 @@ <h3>[method:Matrix4 getInverse]( [page:Matrix4 m] ) [page:Matrix4 this]</h3>
142142

143143
<h3>[method:Matrix4 makeRotationFromEuler]( [page:Euler euler] ) [page:Matrix4 this]</h3>
144144
<div>
145-
euler — Rotation vector followed by order of rotations. Eg. "XYZ".
145+
euler — Rotation vector followed by order of rotations, e.g., "XYZ".
146146
</div>
147147
<div>
148148
Sets the rotation submatrix of this matrix to the rotation specified by Euler angles, the rest of the matrix is identity.<br />
@@ -230,20 +230,20 @@ <h3>[method:Matrix4 makeOrthographic]( [page:Float left], [page:Float right], [p
230230

231231
<h3>[method:Matrix4 clone]()</h3>
232232
<div>
233-
Clones this matrix.
233+
Creates a copy of this matrix.
234234
</div>
235235

236236
<h3>[method:Array applyToVector3Array]([page:Array a])</h3>
237237
<div>
238238
array -- An array in the form [vector1x, vector1y, vector1z, vector2x, vector2y, vector2z, ...]
239239
</div>
240240
<div>
241-
Multiply (apply) this matrix to every vector3 in the array.
241+
Multiplies (applies) this matrix to every vector3 in the array.
242242
</div>
243243

244244
<h3>[method:Float getMaxScaleOnAxis]()</h3>
245245
<div>
246-
Gets the max scale value of the 3 axes.
246+
Gets the maximum scale value of the 3 axes.
247247
</div>
248248

249249
<h2>Source</h2>

examples/index.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -219,6 +219,7 @@ <h1><a href="http://threejs.org">three.js</a> / examples</h1>
219219
"webgl_geometry_nurbs",
220220
"webgl_geometry_shapes",
221221
"webgl_geometry_spline_editor",
222+
"webgl_geometry_teapot",
222223
"webgl_geometry_terrain",
223224
"webgl_geometry_terrain_fog",
224225
"webgl_geometry_terrain_raycast",

0 commit comments

Comments
 (0)