Skip to content

Commit 1e1f5e3

Browse files
committed
edit documentation for extras
1 parent e0bce36 commit 1e1f5e3

File tree

8 files changed

+75
-14
lines changed

8 files changed

+75
-14
lines changed

demos/curves.html

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,6 @@
161161
});
162162
})
163163

164-
165164
// Create the 3D scene; find the HTML canvas and pass it
166165
// to Scene3D.
167166
var scene=new Scene3D(document.getElementById("canvas"));

demos/demoutil.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,6 @@ function pushSettings(updateMeshFunc,settings){
202202
updateShape(updateMeshFunc);
203203
};
204204

205-
206205
function makeMesh(func,resolutionU,resolutionV){
207206
// Default resolution is 50
208207
if(resolutionV==null)resolutionV=resolutionU

extras/camera.js

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,16 @@ Perspective.prototype.update=function(){
2929
/**
3030
* A class for controlling the projection and
3131
* view of a 3D scene, in the nature of an abstract "camera".
32+
* <p>This class is considered a supplementary class to the
33+
* Public Domain HTML 3D Library and is not considered part of that
34+
* library. <p>
35+
* To use this class, you must include the script "extras/camera.js"; the
36+
* class is not included in the "glutil_min.js" file which makes up
37+
* the HTML 3D Library. Example:<pre>
38+
* &lt;script type="text/javascript" src="extras/camera.js">&lt;/script></pre>
3239
* @class
3340
* @alias Camera
34-
* @param {glutil.Scene} A 3D scene to associate with this
41+
* @param {glutil.Scene} scene A 3D scene to associate with this
3542
* camera object.
3643
* @param {number} fov Vertical field of view, in degrees. Should be less
3744
* than 180 degrees. (The smaller

extras/curvetube.js

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -167,8 +167,15 @@ _FrenetFrames.prototype.getSampleAndBasisVectors=function(u){
167167
/**
168168
* Evaluator for a parametric surface in the form
169169
* of a tube extruded from a parametric curve.
170+
* <p>This class is considered a supplementary class to the
171+
* Public Domain HTML 3D Library and is not considered part of that
172+
* library. <p>
173+
* To use this class, you must include the script "extras/curvetube.js"; the
174+
* class is not included in the "glutil_min.js" file which makes up
175+
* the HTML 3D Library. Example:<pre>
176+
* &lt;script type="text/javascript" src="extras/curvetube.js">&lt;/script></pre>
170177
* @class
171-
* @alias glutil.CurveTube
178+
* @alias CurveTube
172179
* @param {Object} func An object that must contain a function
173180
* named "evaluate", which takes the following parameter:<ul>
174181
* <li><code>u</code> - A curve coordinate, generally from 0 to 1.
@@ -181,11 +188,11 @@ _FrenetFrames.prototype.getSampleAndBasisVectors=function(u){
181188
* @param {Object} [sweptCurve] Object describing
182189
* a two-dimensional curve to serve as the cross section of the extruded shape,
183190
* corresponding to the V coordinate of the CurveTube's
184-
* "evaluate" method.
191+
* "evaluate" method.
185192
* If this parameter is null or omitted, uses a circular cross section
186193
* in which the V coordinate ranges from 0 through
187194
* 1. The curve object must contain a function
188-
* named "evaluate", with the same meaning as for the "func" parameter,
195+
* named "evaluate", with the same meaning as for the "func" parameter,
189196
* except the third element, if any, of the return value is ignored.<p>
190197
* The curve need not be closed.<p>
191198
* The cross section will generally have a radius of 1 unit; bigger

extras/evaluators.js

Lines changed: 40 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
21
/*
32
Written by Peter O. in 2015.
43
@@ -10,6 +9,13 @@ at: http://upokecenter.dreamhosters.com/articles/donate-now-2/
109
/**
1110
* Parametric evaluator for a surface of revolution, which results by revolving
1211
* an X/Y curve around an axis.
12+
* <p>This class is considered a supplementary class to the
13+
* Public Domain HTML 3D Library and is not considered part of that
14+
* library. <p>
15+
* To use this class, you must include the script "extras/evaluators.js"; the
16+
* class is not included in the "glutil_min.js" file which makes up
17+
* the HTML 3D Library. Example:<pre>
18+
* &lt;script type="text/javascript" src="extras/evaluators.js">&lt;/script></pre>
1319
* @class
1420
* @alias SurfaceOfRevolution
1521
* @param {Function} curve Curve to rotate about the Z-axis.
@@ -46,7 +52,7 @@ var SurfaceOfRevolution=function(curve,minval,maxval){
4652
}
4753
}
4854
/**
49-
* Creates a parametric evaluator for a surface of revolution
55+
* Creates a parametric evaluator for a surface of revolution
5056
* whose curve is the graph of a single-variable function.
5157
* @param {Function} func Function whose graph will be
5258
* rotated about the Z-axis. The function takes a number
@@ -101,12 +107,19 @@ SurfaceOfRevolution.torus=function(outerRadius,innerRadius,curve){
101107
* Parametric evaluator for a
102108
* curve drawn by a circle that rolls along the inside
103109
* of another circle, whose position is fixed.
110+
* <p>This class is considered a supplementary class to the
111+
* Public Domain HTML 3D Library and is not considered part of that
112+
* library. <p>
113+
* To use this class, you must include the script "extras/evaluators.js"; the
114+
* class is not included in the "glutil_min.js" file which makes up
115+
* the HTML 3D Library. Example:<pre>
116+
* &lt;script type="text/javascript" src="extras/evaluators.js">&lt;/script></pre>
104117
* @class
105118
* @param {number} outerRadius Radius of the circle whose position
106119
* is fixed.
107120
* @param {number} innerRadius Radius of the rolling circle.
108121
* A hypocycloid results when outerRadius=innerRadius.
109-
* @param {number} innerRadius Distance from the center of the
122+
* @param {number} distFromInnerCenter Distance from the center of the
110123
* rolling circle to the drawing pen.
111124
*/
112125
function Hypotrochoid(outerRadius, innerRadius, distFromInnerCenter){
@@ -157,6 +170,22 @@ function Hypotrochoid(outerRadius, innerRadius, distFromInnerCenter){
157170
this.distFromInner*ratio);
158171
}
159172
}
173+
174+
/**
175+
* Parametric evaluator for a
176+
* curve drawn by a circle that rolls along the X-axis.
177+
* <p>This class is considered a supplementary class to the
178+
* Public Domain HTML 3D Library and is not considered part of that
179+
* library. <p>
180+
* To use this class, you must include the script "extras/evaluators.js"; the
181+
* class is not included in the "glutil_min.js" file which makes up
182+
* the HTML 3D Library. Example:<pre>
183+
* &lt;script type="text/javascript" src="extras/evaluators.js">&lt;/script></pre>
184+
* @class
185+
* @param {number} radius Radius of the rolling circle.
186+
* @param {number} distFromCenter Distance from the center of the
187+
* rolling circle to the drawing pen.
188+
*/
160189
function Trochoid(radius, distFromCenter){
161190
this.inner=radius;
162191
this.distFromCenter=distFromCenter;
@@ -184,12 +213,19 @@ function Trochoid(radius, distFromCenter){
184213
* Parametric evaluator for a
185214
* curve drawn by a circle that rolls along the outside
186215
* of another circle, whose position is fixed.
216+
* <p>This class is considered a supplementary class to the
217+
* Public Domain HTML 3D Library and is not considered part of that
218+
* library. <p>
219+
* To use this class, you must include the script "extras/evaluators.js"; the
220+
* class is not included in the "glutil_min.js" file which makes up
221+
* the HTML 3D Library. Example:<pre>
222+
* &lt;script type="text/javascript" src="extras/evaluators.js">&lt;/script></pre>
187223
* @class
188224
* @param {number} outerRadius Radius of the circle whose position
189225
* is fixed.
190226
* @param {number} innerRadius Radius of the rolling circle.
191227
* An epicycloid results when outerRadius=innerRadius.
192-
* @param {number} innerRadius Distance from the center of the
228+
* @param {number} distFromInnerCenter Distance from the center of the
193229
* rolling circle to the drawing pen.
194230
*/
195231
function Epitrochoid(outerRadius, innerRadius, distFromInnerCenter){

extras/matrixstack.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,13 @@ MatrixStack is a class that implements a stack
2121
of 4x4 transformation matrices.<p>
2222
When the constructor is called, it will create a stack whose
2323
only element is the identity matrix.
24+
* <p>This class is considered a supplementary class to the
25+
* Public Domain HTML 3D Library and is not considered part of that
26+
* library. <p>
27+
* To use this class, you must include the script "extras/matrixstack.js"; the
28+
* class is not included in the "glutil_min.js" file which makes up
29+
* the HTML 3D Library. Example:<pre>
30+
* &lt;script type="text/javascript" src="extras/matrixstack.js">&lt;/script></pre>
2431
@alias MatrixStack
2532
@class
2633
*/

extras/objmtl.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,13 @@ at: http://upokecenter.dreamhosters.com/articles/donate-now-2/
88
*/
99
/**
1010
OBJ file.<p>
11-
* To use this class, you must include the script "objmtl.js"; the
11+
* <p>This class is considered a supplementary class to the
12+
* Public Domain HTML 3D Library and is not considered part of that
13+
* library. <p>
14+
* To use this class, you must include the script "extras/objmtl.js"; the
1215
* class is not included in the "glutil_min.js" file which makes up
1316
* the HTML 3D Library. Example:<pre>
14-
* &lt;script type="text/javascript" src="glutil_min.js">&lt;/script></pre>
17+
* &lt;script type="text/javascript" src="extras/objmtl.js">&lt;/script></pre>
1518
@class */
1619
function ObjData(){
1720
/** URL of the OBJ file */

extras/stl.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,13 @@ if(!GLUtil){
1414
var StlData={};
1515
/**
1616
* Loads a .STL file asynchronously.
17-
* To use this class, you must include the script "stl.js"; the
17+
* <p>This method is considered a supplementary method to the
18+
* Public Domain HTML 3D Library and is not considered part of that
19+
* library. <p>
20+
* To use this method, you must include the script "extras/stl.js"; the
1821
* class is not included in the "glutil_min.js" file which makes up
1922
* the HTML 3D Library. Example:<pre>
20-
* &lt;script type="text/javascript" src="stl.js">&lt;/script></pre>
23+
* &lt;script type="text/javascript" src="extras/stl.js">&lt;/script></pre>
2124
@alias glutil.GLUtil.loadStlFromUrl
2225
@param {string} url The URL to load.
2326
@return {Promise} A promise that:

0 commit comments

Comments
 (0)