-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathShapeGroup.html
executable file
·402 lines (307 loc) · 18.2 KB
/
ShapeGroup.html
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
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
<!DOCTYPE html><html xmlns:dc="http://purl.org/dc/terms/"><head><meta http-equiv=Content-Type content="text/html; charset=utf-8"><meta name="viewport" content="width=device-width"><link rel=stylesheet type="text/css" href="/style.css">
<script type="text/x-mathjax-config"> MathJax.Hub.Config({"HTML-CSS": { availableFonts: ["STIX","TeX"], linebreaks: { automatic:true }, preferredFont: "TeX" },
tex2jax: { displayMath: [ ["$$","$$"], ["\\[", "\\]"] ], inlineMath: [ ["$", "$"], ["\\\\(","\\\\)"] ], processEscapes: true } });
</script><script type="text/javascript" async src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/MathJax.js?config=TeX-AMS_HTML-full"></script></head><body> <div class="header">
<nav><p><a href="#navigation">Menu</a> - <a href="#top">Top</a> - <a href="/">Home</a></nav></div>
<div class="mainarea" id="top">
<h1 id="shapegroup">ShapeGroup</h1>
<p><a href="index.html">Back to documentation index.</a></p>
<p><a name="ShapeGroup"></a>
### new ShapeGroup()</p>
<p><strong>Deprecated: It is intended to render this class obsolete and rely on three.js.</strong></p>
<p>Represents a grouping of shapes. This object
can hold both Shape objects and
other <a href="ShapeGroup.html">ShapeGroup</a> objects.</p>
<h3 id="methods">Methods</h3>
<ul>
<li><a href="#ShapeGroup_addShape">addShape</a><br />Adds a 3D shape to this shape group, at the end of the list
of shapes.</li>
<li><a href="#ShapeGroup_copy">copy</a><br />Makes a copy of this shape group and the objects contained
in it.</li>
<li><a href="#ShapeGroup_getBounds">getBounds</a><br />Finds a bounding box that holds all vertices in this shape group.</li>
<li><a href="#ShapeGroup_getMatrix">getMatrix</a><br />Gets a copy of the transformation needed to transform
this shape group’s-coordinates to world coordinates.</li>
<li><a href="#ShapeGroup_getShape">getShape</a><br />Gets the shape or shape group located
in this shape group at the specified index.</li>
<li><a href="#ShapeGroup_getTransform">getTransform</a><br />Gets a reference to the transform used by this shape group object.</li>
<li><a href="#ShapeGroup_getVisible">getVisible</a><br />Gets whether this shape group will be drawn on rendering.</li>
<li><a href="#ShapeGroup_primitiveCount">primitiveCount</a><br />Gets the number of primitives (triangles, lines,
and points) composed by all shapes in this shape group.</li>
<li><a href="#ShapeGroup_removeShape">removeShape</a><br />Removes all instances of a 3D shape from this shape group</li>
<li><a href="#ShapeGroup_setPosition">setPosition</a><br />Sets the relative position of the shapes in this group
from their original position.</li>
<li><a href="#ShapeGroup_setQuaternion">setQuaternion</a><br />Sets this shape group’s rotation in the form of a glmath.</li>
<li><a href="#ShapeGroup_setScale">setScale</a><br />Sets the scale of this shape group relative to its original
size.</li>
<li><a href="#ShapeGroup_setShape">setShape</a><br />Sets a shape or shape group at the specified index in this shape group.</li>
<li><a href="#ShapeGroup_setTransform">setTransform</a><br />Sets the transform used by this shape group to a copy
of the specified transform.</li>
<li><a href="#ShapeGroup_setVisible">setVisible</a><br />Sets whether this shape group will be drawn on rendering.</li>
<li><a href="#ShapeGroup_shapeCount">shapeCount</a><br />Returns the number of shapes and/or shape groups that
are direct children of this shape group.</li>
<li><a href="#ShapeGroup_vertexCount">vertexCount</a><br />Gets the number of vertices composed by all shapes in this shape group.</li>
</ul>
<p><a name="ShapeGroup_addShape"></a>
### ShapeGroup#addShape(shape)</p>
<p>Adds a 3D shape to this shape group, at the end of the list
of shapes. Its reference, not a copy,
will be stored in the list of shapes.</p>
<h4 id="parameters">Parameters</h4>
<ul>
<li><code>shape</code> (Type: <a href="ShapeGroup.html">ShapeGroup</a>)<br />A 3D shape. Throws an error if null.</li>
</ul>
<h4 id="return-value">Return Value</h4>
<p>This object. (Type: <a href="ShapeGroup.html">ShapeGroup</a>)</p>
<p><a name="ShapeGroup_copy"></a>
### ShapeGroup#copy()</p>
<p>Makes a copy of this shape group and the objects contained
in it. The copied object will
will have its own version of the transform and
visibility flag, and any objects contained in this one
will be copied using their <code>copy()</code> method.
The copied shape group won’t have a parent.</p>
<h4 id="return-value-1">Return Value</h4>
<p>A copy of this shape group. (Type: <a href="ShapeGroup.html">ShapeGroup</a>)</p>
<p><a name="ShapeGroup_getBounds"></a>
### ShapeGroup#getBounds()</p>
<p>Finds a bounding box that holds all vertices in this shape group.
The bounding box is not guaranteed to be the
tightest, and the box will be in world space coordinates.</p>
<h4 id="return-value-2">Return Value</h4>
<p>An array of six numbers describing an
axis-aligned bounding box
that fits all vertices in the shape group. The first three numbers
are the smallest-valued x-, y-, and z-coordinates, and the
last three are the largest-valued x-, y-, and z-coordinates.
If the shape group has no vertices, returns the array [Inf, Inf, Inf, -Inf,
-Inf, -Inf]. (Type: Array.<number>)</p>
<p><a name="ShapeGroup_getMatrix"></a>
### ShapeGroup#getMatrix()</p>
<p>Gets a copy of the transformation needed to transform
this shape group’s-coordinates to world coordinates.</p>
<h4 id="return-value-3">Return Value</h4>
<p>A 4 × 4 matrix. (Type: <a href="Transform.html">Transform</a>)</p>
<p><a name="ShapeGroup_getShape"></a>
### ShapeGroup#getShape(index)</p>
<p>Gets the shape or shape group located
in this shape group at the specified index.</p>
<h4 id="parameters-1">Parameters</h4>
<ul>
<li><code>index</code> (Type: number)<br />Integer index, starting from 0, of the shape or shape group to set.</li>
</ul>
<h4 id="return-value-4">Return Value</h4>
<p>The shape or shape group located
in this shape group at the specified index, or null if none is found there. (Type: <a href="ShapeGroup.html">ShapeGroup</a>)</p>
<p><a name="ShapeGroup_getTransform"></a>
### ShapeGroup#getTransform()</p>
<p>Gets a reference to the transform used by this shape group object.</p>
<h4 id="return-value-5">Return Value</h4>
<p>Return value. (Type: <a href="Transform.html">Transform</a>)</p>
<p><a name="ShapeGroup_getVisible"></a>
### ShapeGroup#getVisible()</p>
<p>Gets whether this shape group will be drawn on rendering.</p>
<h4 id="return-value-6">Return Value</h4>
<p>value True if this shape group will be visible; otherwise, false. (Type: boolean)</p>
<p><a name="ShapeGroup_primitiveCount"></a>
### ShapeGroup#primitiveCount()</p>
<p>Gets the number of primitives (triangles, lines,
and points) composed by all shapes in this shape group.</p>
<h4 id="return-value-7">Return Value</h4>
<p>Return value. (Type: number)</p>
<p><a name="ShapeGroup_removeShape"></a>
### ShapeGroup#removeShape(shape)</p>
<p>Removes all instances of a 3D shape from this shape group</p>
<h4 id="parameters-2">Parameters</h4>
<ul>
<li><code>shape</code> (Type: <a href="ShapeGroup.html">ShapeGroup</a>)<br />The 3D shape to remove.</li>
</ul>
<h4 id="return-value-8">Return Value</h4>
<p>This object. (Type: <a href="ShapeGroup.html">ShapeGroup</a>)</p>
<p><a name="ShapeGroup_setPosition"></a>
### ShapeGroup#setPosition(x, y, z)</p>
<p>Sets the relative position of the shapes in this group
from their original position.
See <a href="Transform.html#Transform_setPosition">Transform#setPosition</a>
This method will modify this shape group’s transform
rather than the transform for each shape in the group.</p>
<h4 id="parameters-3">Parameters</h4>
<ul>
<li>
<table>
<tbody>
<tr>
<td><code>x</code> (Type: number</td>
<td>Array.<number>)<br />x-coordinate or a 3-element position array, as specified in <a href="Transform.html#Transform_setScale">Transform#setScale</a>.</td>
</tr>
</tbody>
</table>
</li>
<li><code>y</code> (Type: number)<br />The y-coordinate.</li>
<li><code>z</code> (Type: number)<br />The z-coordinate.</li>
</ul>
<h4 id="return-value-9">Return Value</h4>
<p>This object. (Type: <a href="ShapeGroup.html">ShapeGroup</a>)</p>
<p><a name="ShapeGroup_setQuaternion"></a>
### ShapeGroup#setQuaternion(quat)</p>
<p>Sets this shape group’s rotation in the form of a glmath.
See <a href="Transform.html#Transform_setQuaternion">Transform#setQuaternion</a>.
This method will modify this shape group’s transform
rather than the transform for each shape in the group.</p>
<h4 id="parameters-4">Parameters</h4>
<ul>
<li><code>quat</code> (Type: Array.<number>)<br />A four-element array describing the rotation.</li>
</ul>
<h4 id="return-value-10">Return Value</h4>
<p>This object. (Type: <a href="ShapeGroup.html">ShapeGroup</a>)</p>
<p><a name="ShapeGroup_setScale"></a>
### ShapeGroup#setScale(x, y, z)</p>
<p>Sets the scale of this shape group relative to its original
size. See <a href="Transform.html#Transform_setScale">Transform#setScale</a>.
This method will modify this shape group’s transform
rather than the transform for each shape in the group.</p>
<h4 id="parameters-5">Parameters</h4>
<ul>
<li>
<table>
<tbody>
<tr>
<td><code>x</code> (Type: number</td>
<td>Array.<number>)<br />Scaling factor for this object’s width, or a 3-element scaling array, as specified in <a href="Transform.html#Transform_setScale">Transform#setScale</a>.</td>
</tr>
</tbody>
</table>
</li>
<li><code>y</code> (Type: number)<br />Scaling factor for this object’s height.</li>
<li><code>z</code> (Type: number)<br />Scaling factor for this object’s depth.</li>
</ul>
<h4 id="return-value-11">Return Value</h4>
<p>This object. (Type: <a href="ShapeGroup.html">ShapeGroup</a>)</p>
<p><a name="ShapeGroup_setShape"></a>
### ShapeGroup#setShape(index, shape)</p>
<p>Sets a shape or shape group at the specified index in this shape group.</p>
<h4 id="parameters-6">Parameters</h4>
<ul>
<li><code>index</code> (Type: number)<br />Integer index, starting from 0, to set the shape or shape group at.</li>
<li><code>shape</code> (Type: <a href="ShapeGroup.html">ShapeGroup</a>)<br />Shape object to set at the specified index.</li>
</ul>
<h4 id="return-value-12">Return Value</h4>
<p>This object. (Type: <a href="ShapeGroup.html">ShapeGroup</a>)</p>
<p><a name="ShapeGroup_setTransform"></a>
### ShapeGroup#setTransform(transform)</p>
<p>Sets the transform used by this shape group to a copy
of the specified transform. Child
shapes can set their own transforms, in which case the
rendering process will multiply this shape group’s transform
with the child shape’s transform as it renders the child shape.</p>
<h4 id="parameters-7">Parameters</h4>
<ul>
<li><code>transform</code> (Type: <a href="Transform.html">Transform</a>)<br />The transform to copy for the use of this shape group.</li>
</ul>
<h4 id="return-value-13">Return Value</h4>
<p>Return value. (Type: Object)</p>
<p><a name="ShapeGroup_setVisible"></a>
### ShapeGroup#setVisible(value)</p>
<p>Sets whether this shape group will be drawn on rendering.</p>
<h4 id="parameters-8">Parameters</h4>
<ul>
<li><code>value</code> (Type: boolean)<br />True if this shape group will be visible; otherwise, false.</li>
</ul>
<h4 id="return-value-14">Return Value</h4>
<p>This object. (Type: <a href="ShapeGroup.html">ShapeGroup</a>)</p>
<p><a name="ShapeGroup_shapeCount"></a>
### ShapeGroup#shapeCount()</p>
<p>Returns the number of shapes and/or shape groups that
are direct children of this shape group.</p>
<h4 id="return-value-15">Return Value</h4>
<p>Return value. (Type: number)</p>
<p><a name="ShapeGroup_vertexCount"></a>
### ShapeGroup#vertexCount()</p>
<p>Gets the number of vertices composed by all shapes in this shape group.</p>
<h4 id="return-value-16">Return Value</h4>
<p>Return value. (Type: number)</p>
<p><a href="index.html">Back to documentation index.</a></p>
</div><nav id="navigation"><ul>
<li><a href="/">Back to start site.</a>
<li><a href="https://github.com/peteroupc/peteroupc.github.io">This site's repository (source code)</a>
<li><a href="https://github.com/peteroupc/peteroupc.github.io/issues">Post an issue or comment</a></ul>
<div class="noprint">
<p>
<a href="//twitter.com/intent/tweet">Share via Twitter</a>, <a href="//www.facebook.com/sharer/sharer.php" id="sharer">Share via Facebook</a>
</p>
</div>
<h3 id="navigation">Navigation</h3>
<ul>
<li><a href="BSplineCurve.html">BSplineCurve</a></li>
<li><a href="BSplineSurface.html">BSplineSurface</a></li>
<li><a href="Curve.html">Curve</a></li>
<li><a href="CurveBuilder.html">CurveBuilder</a></li>
<li><a href="GraphicsPath.html">GraphicsPath</a></li>
<li><a href="H3DU.html">H3DU</a></li>
<li><a href="MathUtil.html">MathUtil</a></li>
<li><a href="MeshBuffer.html">MeshBuffer</a></li>
<li><a href="Meshes.html">Meshes</a></li>
<li><a href="PiecewiseCurve.html">PiecewiseCurve</a></li>
<li><a href="Surface.html">Surface</a></li>
<li><a href="SurfaceBuilder.html">SurfaceBuilder</a></li>
<li><a href="Transform.html">Transform</a></li>
<li><a href="extras_camera.html">module:extras/camera</a></li>
<li><a href="extras_camera.Camera.html">module:extras/camera.Camera</a></li>
<li><a href="extras_camera.InputTracker.html">module:extras/camera.InputTracker</a></li>
<li><a href="extras_createwasher.html">module:extras/createwasher</a></li>
<li><a href="extras_curvetube.html">module:extras/curvetube</a></li>
<li><a href="extras_curvetube.CurveTube.html">module:extras/curvetube.CurveTube</a></li>
<li><a href="extras_derivedcurves.html">module:extras/derivedcurves</a></li>
<li><a href="extras_evaluators.html">module:extras/evaluators</a></li>
<li><a href="extras_evaluators.Roulette.html">module:extras/evaluators.Roulette</a></li>
<li><a href="extras_evaluators.SurfaceOfRevolution.html">module:extras/evaluators.SurfaceOfRevolution</a></li>
<li><a href="extras_fourierknot.html">module:extras/fourierknot</a></li>
<li><a href="extras_gradients.html">module:extras/gradients</a></li>
<li><a href="extras_matrixstack.html">module:extras/matrixstack</a></li>
<li><a href="extras_matrixstack.MatrixStack.html">module:extras/matrixstack.MatrixStack</a></li>
<li><a href="extras_meshes_arrow.html">module:extras/meshes/arrow</a></li>
<li><a href="extras_meshes_contourlines.html">module:extras/meshes/contourlines</a></li>
<li><a href="extras_meshes_convex.html">module:extras/meshes/convex</a></li>
<li><a href="extras_meshes_createfloor.html">module:extras/meshes/createfloor</a></li>
<li><a href="extras_meshes_drawingtoy.html">module:extras/meshes/drawingtoy</a></li>
<li><a href="extras_meshes_drawingtoy.DrawingToy.html">module:extras/meshes/drawingtoy.DrawingToy</a></li>
<li><a href="extras_meshes_gearmesh.html">module:extras/meshes/gearmesh</a></li>
<li><a href="extras_meshes_pathtomesh.html">module:extras/meshes/pathtomesh</a></li>
<li><a href="extras_meshes_polyhedra.html">module:extras/meshes/polyhedra</a></li>
<li><a href="extras_meshes_polyhedra.Polyhedra.html">module:extras/meshes/polyhedra.Polyhedra</a></li>
<li><a href="extras_meshes_raypick.html">module:extras/meshes/raypick</a></li>
<li><a href="extras_meshes_starfield.html">module:extras/meshes/starfield</a></li>
<li><a href="extras_meshes_starfield.StarField.html">module:extras/meshes/starfield.StarField</a></li>
<li><a href="extras_meshes_stl.html">module:extras/meshes/stl</a></li>
<li><a href="extras_meshes_text.html">module:extras/meshes/text</a></li>
<li><a href="extras_meshes_text.TextFont.html">module:extras/meshes/text.TextFont</a></li>
<li><a href="extras_moresurfaces.html">module:extras/moresurfaces</a></li>
<li><a href="extras_moresurfaces.KleinBottle.html">module:extras/moresurfaces.KleinBottle</a></li>
<li><a href="extras_moresurfaces.MoebiusStrip.html">module:extras/moresurfaces.MoebiusStrip</a></li>
<li><a href="extras_pathutil.html">module:extras/pathutil</a></li>
<li><a href="extras_randompolygon.html">module:extras/randompolygon</a></li>
<li><a href="extras_shaders_checkerboardshader.html">module:extras/shaders/checkerboardshader</a></li>
<li><a href="extras_shaders_colormatrixshader.html">module:extras/shaders/colormatrixshader</a></li>
<li><a href="extras_shaders_fragmentshaderlib.html">module:extras/shaders/fragmentshaderlib</a></li>
<li><a href="extras_shaders_horgradshader.html">module:extras/shaders/horgradshader</a></li>
<li><a href="extras_shaders_kernelmatrixshader.html">module:extras/shaders/kernelmatrixshader</a></li>
<li><a href="extras_shaders_marbleshader.html">module:extras/shaders/marbleshader</a></li>
<li><a href="extras_shaders_marbleshader2.html">module:extras/shaders/marbleshader2</a></li>
<li><a href="extras_shaders_mirrorshader.html">module:extras/shaders/mirrorshader</a></li>
<li><a href="extras_shaders_pixelateshader.html">module:extras/shaders/pixelateshader</a></li>
<li><a href="extras_shaders_radgradshader.html">module:extras/shaders/radgradshader</a></li>
<li><a href="extras_shaders_skysphereshader.html">module:extras/shaders/skysphereshader</a></li>
<li><a href="extras_shaders_stripesbackshader.html">module:extras/shaders/stripesbackshader</a></li>
<li><a href="extras_shaders_sunburstbackshader.html">module:extras/shaders/sunburstbackshader</a></li>
<li><a href="extras_shaders_vignetteshader.html">module:extras/shaders/vignetteshader</a></li>
<li><a href="extras_shaders_warpshader.html">module:extras/shaders/warpshader</a></li>
<li><a href="extras_shaders_waterpaintshader.html">module:extras/shaders/waterpaintshader</a></li>
<li><a href="extras_shaders_waveshader.html">module:extras/shaders/waveshader</a></li>
<li><a href="extras_shaders_woodshader.html">module:extras/shaders/woodshader</a></li>
<li><a href="extras_starpolygon.html">module:extras/starpolygon</a></li>
<li><a href="extras_superellipsoid.html">module:extras/superellipsoid</a></li>
<li><a href="extras_superellipsoid.Supershape.html">module:extras/superellipsoid.Supershape</a></li>
<li><a href="extras_superellipsoid.Supertoroid.html">module:extras/superellipsoid.Supertoroid</a></li>
<li><a href="extras_torusknot.html">module:extras/torusknot</a></li>
<li><a href="extras_torusknot.TorusKnot.html">module:extras/torusknot.TorusKnot</a></li>
</ul>
</nav></body></html>