Skip to content

Commit 64d2852

Browse files
committed
Add Mesh#toMeshBuffer to replace functionality in MeshBuffer constructor; edit docs; etc.
1 parent a28eaa5 commit 64d2852

28 files changed

+472
-429
lines changed

demos/animation.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ function makeFloor(xStart, yStart, width, height, tileSize, z) {
175175
.texCoord2(endX, endY).vertex3(endPosX, endPosY, z);
176176
}
177177
}
178-
return new H3DU.MeshBuffer(mesh);
178+
return mesh.toMeshBuffer();
179179
}
180180

181181
/* exported rotateVec */

demos/bsp.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ BspTree.prototype.toMeshBuffer = function() {
3434
"use strict";
3535
var mesh = new H3DU.Mesh();
3636
this._toMeshInternal(mesh);
37-
return new H3DU.MeshBuffer(mesh);
37+
return mesh.toMeshBuffer();
3838
};
3939
/** @ignore */
4040
BspTree.prototype._toMeshInternal = function(mesh) {

demos/pathutil.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ function pathFloor(path, z, flatness) {
3535
.vertex3(tri[2], tri[3], z)
3636
.vertex3(tri[4], tri[5], z);
3737
}
38-
return new H3DU.MeshBuffer(mesh);
38+
return mesh.toMeshBuffer();
3939
}
4040

4141
/* exported pointMarch */

doc/H3DU.BufferHelper.md

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -28,11 +28,11 @@ Copies the values of a vertex attribute into a new vertex attribute object.
2828

2929
#### Parameters
3030

31-
* `attr` (Type: Array.&lt;Object>)<br>A vertex buffer accessor.
31+
* `attr` (Type: <a href="H3DU.BufferAccessor.md">H3DU.BufferAccessor</a>)<br>A vertex buffer accessor.
3232

3333
#### Return Value
3434

35-
A copy of the vertex attribute object. (Type: Array.&lt;Object>)
35+
A copy of the vertex attribute object. (Type: <a href="H3DU.BufferAccessor.md">H3DU.BufferAccessor</a>)
3636

3737
<a name='H3DU.BufferHelper_get'></a>
3838
### H3DU.BufferHelper#get(a, index)
@@ -44,12 +44,12 @@ checking naturally done when accessing the attribute's buffer.
4444

4545
#### Parameters
4646

47-
* `a` (Type: H3DU.BufferAccessor)<br>A vertex buffer accessor.
47+
* `a` (Type: <a href="H3DU.BufferAccessor.md">H3DU.BufferAccessor</a>)<br>A vertex buffer accessor.
4848
* `index` (Type: number)<br>A numeric index, starting from 0, that identifies a value stored in the attribute's buffer. For example, 0 identifies the first value, 1 identifies the second, and so on.
4949

5050
#### Return Value
5151

52-
Return value. (Type: *)
52+
The first element of the given attribute value. (Type: number)
5353

5454
<a name='H3DU.BufferHelper_getVec'></a>
5555
### H3DU.BufferHelper#getVec(a, index, vec)
@@ -61,9 +61,9 @@ checking naturally done when accessing the attribute's buffer.
6161

6262
#### Parameters
6363

64-
* `a` (Type: H3DU.BufferAccessor)<br>A vertex buffer accessor.
64+
* `a` (Type: <a href="H3DU.BufferAccessor.md">H3DU.BufferAccessor</a>)<br>A vertex buffer accessor.
6565
* `index` (Type: number)<br>A numeric index, starting from 0, that identifies a value stored in the attribute's buffer. For example, 0 identifies the first value, 1 identifies the second, and so on.
66-
* `vec` (Type: Array.&lt;number>)<br>An array whose elements will be set to those of the value at the given index. The number of elements copied to this array is the attribute's count per value (see H3DU.BufferHelper.countPerValue).
66+
* `vec` (Type: Array.&lt;number>)<br>An array whose elements will be set to those of the value at the given index. The number of elements copied to this array is the attribute's count per value (see <a href="H3DU.BufferAccessor.md#H3DU.BufferAccessor_countPerValue">H3DU.BufferAccessor#countPerValue</a>).
6767

6868
#### Return Value
6969

@@ -90,16 +90,16 @@ combined vertex attribute.
9090

9191
#### Parameters
9292

93-
* `attr1` (Type: H3DU.BufferAccessor)<br>A vertex buffer accessor for the first vertex attribute. Can be null, in which case it is assumed that the attribute contains as many values as indices and all the values are zeros.
93+
* `attr1` (Type: <a href="H3DU.BufferAccessor.md">H3DU.BufferAccessor</a>)<br>A vertex buffer accessor for the first vertex attribute. Can be null, in which case it is assumed that the attribute contains as many values as indices and all the values are zeros.
9494
* `indices1` (Type: Array.&lt;number> | Uint16Array | Uint8Array | Uint32Array)<br>An array of vertex indices associated with the first vertex attribute.
95-
* `attr2` (Type: H3DU.BufferAccessor)<br>A vertex buffer accessor for the second vertex attribute. Can be null, in which case it is assumed that the attribute contains as many values as indices and all the values are zeros.
95+
* `attr2` (Type: <a href="H3DU.BufferAccessor.md">H3DU.BufferAccessor</a>)<br>A vertex buffer accessor for the second vertex attribute. Can be null, in which case it is assumed that the attribute contains as many values as indices and all the values are zeros.
9696
* `indices2` (Type: Array.&lt;number> | Uint16Array | Uint8Array | Uint32Array)<br>An array of vertex indices associated with the second vertex attribute.
9797

9898
#### Return Value
9999

100100
The merged attribute, where the vertices from the first vertex
101101
attribute come before those from the second. The merged attribute will have as many
102-
values as the sum of the lengths of "indices1" and "indices2". (Type: H3DU.BufferAccessor)
102+
values as the sum of the lengths of "indices1" and "indices2". (Type: <a href="H3DU.BufferAccessor.md">H3DU.BufferAccessor</a>)
103103

104104
<a name='H3DU.BufferHelper_resolveSemantic'></a>
105105
### H3DU.BufferHelper#resolveSemantic(name, [index])
@@ -130,7 +130,7 @@ checking naturally done when writing to the attribute's buffer.
130130

131131
#### Parameters
132132

133-
* `a` (Type: H3DU.BufferAccessor)<br>A vertex buffer accessor.
133+
* `a` (Type: <a href="H3DU.BufferAccessor.md">H3DU.BufferAccessor</a>)<br>A vertex buffer accessor.
134134
* `index` (Type: number)<br>A numeric index, starting from 0, that identifies a value stored in the attribute's buffer. For example, 0 identifies the first value, 1 identifies the second, and so on.
135135
* `value` (Type: number)<br>The number to set the first element to.
136136

@@ -149,9 +149,9 @@ where noted otherwise.
149149

150150
#### Parameters
151151

152-
* `a` (Type: H3DU.BufferAccessor)<br>A vertex buffer accessor.
152+
* `a` (Type: <a href="H3DU.BufferAccessor.md">H3DU.BufferAccessor</a>)<br>A vertex buffer accessor.
153153
* `index` (Type: number)<br>A numeric index, starting from 0, that identifies a value stored in the attribute's buffer. For example, 0 identifies the first value, 1 identifies the second, and so on.
154-
* `vec` (Type: Array.&lt;number>)<br>An array containing the elements to copy to the value at the given index. The number of elements copied is this array's length or the attribute's count per value (see H3DU.BufferHelper.countPerValue), whichever is less.
154+
* `vec` (Type: Array.&lt;number>)<br>An array containing the elements to copy to the value at the given index. The number of elements copied is this array's length or the attribute's count per value (see <a href="H3DU.BufferAccessor.md#H3DU.BufferAccessor_countPerValue">H3DU.BufferAccessor#countPerValue</a>), whichever is less.
155155

156156
#### Return Value
157157

doc/H3DU.Mesh.md

Lines changed: 40 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -82,24 +82,25 @@ semantic.</b>
8282
* [color3](#H3DU.Mesh_color3)<br>Sets the current color for this mesh.
8383
* [enumPrimitives](#H3DU.Mesh_enumPrimitives)<br>Enumerates the primitives (lines, triangles, and points) included
8484
in this mesh.
85-
* [getBoundingBox](#H3DU.Mesh_getBoundingBox)<br><b>Deprecated: Use <code>new H3DU.MeshBuffer(this).getBounds()</code> instead.</b>
85+
* [getBoundingBox](#H3DU.Mesh_getBoundingBox)<br><b>Deprecated: Use <code>(this).toMeshBuffer().getBounds()</code> instead.</b>
8686
* [getVertex](#H3DU.Mesh_getVertex)<br>Gets the position of the vertex with the given
8787
index in this mesh.
8888
* [getVertexNormal](#H3DU.Mesh_getVertexNormal)<br>Gets the normal of the vertex with the given
8989
index in this mesh.
90-
* [merge](#H3DU.Mesh_merge)<br><b>Deprecated: Use <code>new H3DU.MeshBuffer(mesh).merge(other)</code> instead.</b>
90+
* [merge](#H3DU.Mesh_merge)<br><b>Deprecated: Use <code>(mesh).toMeshBuffer().merge(other)</code> instead.</b>
9191
* [mode](#H3DU.Mesh_mode)<br>Changes the primitive mode for this mesh.
9292
* [normal3](#H3DU.Mesh_normal3)<br>Sets the current normal for this mesh.
93-
* [normalizeNormals](#H3DU.Mesh_normalizeNormals)<br><b>Deprecated: Use <code>new H3DU.MeshBuffer(this).reverseNormals()</code> instead.</b>
93+
* [normalizeNormals](#H3DU.Mesh_normalizeNormals)<br><b>Deprecated: Use <code>(this).toMeshBuffer().reverseNormals()</code> instead.</b>
9494
* [primitiveCount](#H3DU.Mesh_primitiveCount)<br>Gets the number of primitives (triangles, lines,
9595
or points) that this mesh contains.
96-
* [recalcNormals](#H3DU.Mesh_recalcNormals)<br><b>Deprecated: Use <code>new H3DU.MeshBuffer(this).recalcNormals()</code> instead.</b>
96+
* [recalcNormals](#H3DU.Mesh_recalcNormals)<br><b>Deprecated: Use <code>(this).toMeshBuffer().recalcNormals()</code> instead.</b>
9797
* [recalcTangents](#H3DU.Mesh_recalcTangents)<br><b>Deprecated: Deprecated because the default shader no longer
98-
uses tangent and bitangent attributes for normal mapping. This method
99-
may be reimplemented in the <a href="H3DU.MeshBuffer.md">H3DU.MeshBuffer</a> class in the future.</b>
100-
* [reverseNormals](#H3DU.Mesh_reverseNormals)<br><b>Deprecated: Use <code>new H3DU.MeshBuffer(this).reverseNormals()</code> instead.</b>
101-
* [reverseWinding](#H3DU.Mesh_reverseWinding)<br><b>Deprecated: Use <code>new H3DU.MeshBuffer(this).reverseWinding()</code> instead.</b>
102-
* [setColor3](#H3DU.Mesh_setColor3)<br><b>Deprecated: Use <code>new H3DU.MeshBuffer(this).setColor(r)</code> instead.</b>
98+
uses tangent and bitangent attributes for normal mapping. A similar method to
99+
this one may be exposed in the <a href="H3DU.MeshBuffer.md">H3DU.MeshBuffer</a> class's public API
100+
in the future.</b>
101+
* [reverseNormals](#H3DU.Mesh_reverseNormals)<br><b>Deprecated: Use <code>(this).toMeshBuffer().reverseNormals()</code> instead.</b>
102+
* [reverseWinding](#H3DU.Mesh_reverseWinding)<br><b>Deprecated: Use <code>(this).toMeshBuffer().reverseWinding()</code> instead.</b>
103+
* [setColor3](#H3DU.Mesh_setColor3)<br><b>Deprecated: Use <code>(this).toMeshBuffer().setColor(r)</code> instead.</b>
103104
* [setVertex](#H3DU.Mesh_setVertex)<br>Sets the X, Y, and Z coordinates of the vertex with the
104105
given index.
105106
* [setVertexNormal](#H3DU.Mesh_setVertexNormal)<br>Sets the normal associated with the vertex with the
@@ -110,9 +111,10 @@ tangent vectors for a mesh, use the <a href="H3DU.MeshBuffer.md">H3DU.MeshBuffer
110111
and create a buffer attribute with the H3DU.Semantics.TANGENT
111112
semantic.</b>
112113
* [texCoord2](#H3DU.Mesh_texCoord2)<br>Sets the current texture coordinates for this mesh.
113-
* [toWireFrame](#H3DU.Mesh_toWireFrame)<br>Converts this mesh to a new mesh with triangles converted
114-
to line segments.
115-
* [transform](#H3DU.Mesh_transform)<br><b>Deprecated: Use <code>new H3DU.MeshBuffer(this).transform()</code> instead.</b>
114+
* [toMeshBuffer](#H3DU.Mesh_toMeshBuffer)<br>Generates a mesh buffer from the information in this mesh object.
115+
* [toWireFrame](#H3DU.Mesh_toWireFrame)<br><b>Deprecated: Use <code>mesh.toMeshBuffer().wireFrame()</code>
116+
instead.</b>
117+
* [transform](#H3DU.Mesh_transform)<br><b>Deprecated: Use <code>(this).toMeshBuffer().transform()</code> instead.</b>
116118
* [vertex2](#H3DU.Mesh_vertex2)<br>Adds a new vertex to this mesh.
117119
* [vertex3](#H3DU.Mesh_vertex3)<br>Adds a new vertex to this mesh.
118120
* [vertexCount](#H3DU.Mesh_vertexCount)<br>Gets the number of vertices included in this mesh.
@@ -318,7 +320,7 @@ This object. (Type: <a href="H3DU.Mesh.md">H3DU.Mesh</a>)
318320
<a name='H3DU.Mesh_getBoundingBox'></a>
319321
### H3DU.Mesh#getBoundingBox()
320322

321-
<b>Deprecated: Use <code>new H3DU.MeshBuffer(this).getBounds()</code> instead.</b>
323+
<b>Deprecated: Use <code>(this).toMeshBuffer().getBounds()</code> instead.</b>
322324

323325
Finds the tightest axis-aligned
324326
bounding box that holds all vertices in the mesh.
@@ -372,7 +374,7 @@ a normal. (Type: Array.&lt;number>)
372374
<a name='H3DU.Mesh_merge'></a>
373375
### H3DU.Mesh#merge(other)
374376

375-
<b>Deprecated: Use <code>new H3DU.MeshBuffer(mesh).merge(other)</code> instead.</b>
377+
<b>Deprecated: Use <code>(mesh).toMeshBuffer().merge(other)</code> instead.</b>
376378

377379
Merges the vertices from another mesh into this one.
378380
The vertices from the other mesh will be copied into this one,
@@ -436,7 +438,7 @@ This object. (Type: <a href="H3DU.Mesh.md">H3DU.Mesh</a>)
436438
<a name='H3DU.Mesh_normalizeNormals'></a>
437439
### H3DU.Mesh#normalizeNormals()
438440

439-
<b>Deprecated: Use <code>new H3DU.MeshBuffer(this).reverseNormals()</code> instead.</b>
441+
<b>Deprecated: Use <code>(this).toMeshBuffer().reverseNormals()</code> instead.</b>
440442

441443
Modifies this mesh by converting the normals it defines
442444
to "unit vectors" ("normalized" vectors with a length of 1).
@@ -458,7 +460,7 @@ Return value. (Type: number)
458460
<a name='H3DU.Mesh_recalcNormals'></a>
459461
### H3DU.Mesh#recalcNormals(flat, inward)
460462

461-
<b>Deprecated: Use <code>new H3DU.MeshBuffer(this).recalcNormals()</code> instead.</b>
463+
<b>Deprecated: Use <code>(this).toMeshBuffer().recalcNormals()</code> instead.</b>
462464

463465
Recalculates the normal vectors for triangles
464466
in this mesh. For this to properly affect shading, each triangle in
@@ -480,8 +482,9 @@ This object. (Type: <a href="H3DU.Mesh.md">H3DU.Mesh</a>)
480482
### H3DU.Mesh#recalcTangents()
481483

482484
<b>Deprecated: Deprecated because the default shader no longer
483-
uses tangent and bitangent attributes for normal mapping. This method
484-
may be reimplemented in the <a href="H3DU.MeshBuffer.md">H3DU.MeshBuffer</a> class in the future.</b>
485+
uses tangent and bitangent attributes for normal mapping. A similar method to
486+
this one may be exposed in the <a href="H3DU.MeshBuffer.md">H3DU.MeshBuffer</a> class's public API
487+
in the future.</b>
485488

486489
Recalculates the tangent and bitangent vectors for triangles
487490
in this mesh. This method only has an effect if this mesh
@@ -494,7 +497,7 @@ This object. (Type: <a href="H3DU.Mesh.md">H3DU.Mesh</a>)
494497
<a name='H3DU.Mesh_reverseNormals'></a>
495498
### H3DU.Mesh#reverseNormals()
496499

497-
<b>Deprecated: Use <code>new H3DU.MeshBuffer(this).reverseNormals()</code> instead.</b>
500+
<b>Deprecated: Use <code>(this).toMeshBuffer().reverseNormals()</code> instead.</b>
498501

499502
Modifies this mesh by reversing the sign of normals it defines.
500503
If this mesh defines normals, also resets the primitive
@@ -508,7 +511,7 @@ This object. (Type: <a href="H3DU.Mesh.md">H3DU.Mesh</a>)
508511
<a name='H3DU.Mesh_reverseWinding'></a>
509512
### H3DU.Mesh#reverseWinding()
510513

511-
<b>Deprecated: Use <code>new H3DU.MeshBuffer(this).reverseWinding()</code> instead.</b>
514+
<b>Deprecated: Use <code>(this).toMeshBuffer().reverseWinding()</code> instead.</b>
512515

513516
Reverses the winding order of the triangles in this mesh
514517
by swapping the second and third vertex indices of each one.
@@ -520,7 +523,7 @@ This object. (Type: <a href="H3DU.Mesh.md">H3DU.Mesh</a>)
520523
<a name='H3DU.Mesh_setColor3'></a>
521524
### H3DU.Mesh#setColor3(r, g, b)
522525

523-
<b>Deprecated: Use <code>new H3DU.MeshBuffer(this).setColor(r)</code> instead.</b>
526+
<b>Deprecated: Use <code>(this).toMeshBuffer().setColor(r)</code> instead.</b>
524527

525528
Sets all the vertices in this mesh to the given color.
526529
This method doesn't change this mesh's current color.
@@ -621,14 +624,26 @@ right corner (by default).
621624

622625
This object. (Type: <a href="H3DU.Mesh.md">H3DU.Mesh</a>)
623626

627+
<a name='H3DU.Mesh_toMeshBuffer'></a>
628+
### H3DU.Mesh#toMeshBuffer()
629+
630+
Generates a mesh buffer from the information in this mesh object.
631+
632+
#### Return Value
633+
634+
The generated mesh buffer. (Type: <a href="H3DU.MeshBuffer.md">H3DU.MeshBuffer</a>)
635+
624636
<a name='H3DU.Mesh_toWireFrame'></a>
625637
### H3DU.Mesh#toWireFrame()
626638

639+
<b>Deprecated: Use <code>mesh.toMeshBuffer().wireFrame()</code>
640+
instead.</b>
641+
627642
Converts this mesh to a new mesh with triangles converted
628-
to line segments. The new mesh will reuse the vertices
629-
contained in this one without copying the vertices. If the mesh consists
643+
to line segments. If the mesh consists
630644
of points or line segments, it will remain
631-
unchanged.
645+
unchanged. Unlike in previous versions, the new mesh will
646+
not necessarily reuse the vertices contained in this one.
632647

633648
#### Return Value
634649

@@ -638,7 +653,7 @@ to lines. (Type: <a href="H3DU.Mesh.md">H3DU.Mesh</a>)
638653
<a name='H3DU.Mesh_transform'></a>
639654
### H3DU.Mesh#transform(matrix)
640655

641-
<b>Deprecated: Use <code>new H3DU.MeshBuffer(this).transform()</code> instead.</b>
656+
<b>Deprecated: Use <code>(this).toMeshBuffer().transform()</code> instead.</b>
642657

643658
Transforms the positions and normals of all the vertices currently
644659
in this mesh. The matrix won't affect vertices added afterwards, and

doc/H3DU.MeshBuffer.md

Lines changed: 24 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
[Back to documentation index.](index.md)
44

55
<a name='H3DU.MeshBuffer'></a>
6-
### H3DU.MeshBuffer([mesh])
6+
### H3DU.MeshBuffer()
77

88
A geometric mesh in the form of buffer objects.
99
A mesh buffer is made up of one or more <a href="H3DU.BufferHelper.md">vertex attribute objects</a>,
@@ -12,9 +12,7 @@ the values of one attribute of the mesh, such as positions,
1212
vertex normals, and texture coordinates. A mesh buffer
1313
can store vertices that make up triangles, line segments, or points.
1414

15-
#### Parameters
16-
17-
* `mesh` (Type: <a href="H3DU.Mesh.md">H3DU.Mesh</a>) (optional)<br>A geometric mesh object. A series of default attributes will be set based on that mesh's data. If null, undefined, or omitted, an empty mesh buffer will be generated.
15+
This constructor creates an empty mesh buffer.
1816

1917
### Methods
2018

@@ -43,14 +41,16 @@ assigning each value with the attribute semantic <code>COLOR</code>
4341
to the given color.
4442
* [setIndices](#H3DU.MeshBuffer_setIndices)<br>Sets the vertex indices used by this mesh buffer.
4543
* [setPrimitiveType](#H3DU.MeshBuffer_setPrimitiveType)<br>Sets the type of graphics primitives stored in this mesh buffer.
44+
* [toWireFrame](#H3DU.MeshBuffer_toWireFrame)<br><b>Deprecated: Included here for compatibility with <a href="H3DU.Mesh.md">H3DU.Mesh</a>.
45+
Use H3DU.MeshBuffer.wireFrame instead.</b>
4646
* [transform](#H3DU.MeshBuffer_transform)<br>Transforms the positions and normals of all the vertices currently
4747
in this mesh.
4848
* [vertexCount](#H3DU.MeshBuffer_vertexCount)<br>Gets the number of vertices in this mesh buffer, that
4949
is, the number of vertex indices in its index buffer (some of which
5050
may be duplicates).
5151
* [vertexIndices](#H3DU.MeshBuffer_vertexIndices)<br>Gets the vertex indices of a given primitive (triangle, line,
5252
or point) in this mesh buffer.
53-
* [wireFrame](#H3DU.MeshBuffer_wireFrame)<br>TODO: Not documented yet.
53+
* [wireFrame](#H3DU.MeshBuffer_wireFrame)<br>Converts the triangles in this mesh to line segments.
5454

5555
<a name='H3DU.MeshBuffer_getAttribute'></a>
5656
### H3DU.MeshBuffer#getAttribute(name, [semanticIndex])
@@ -65,7 +65,7 @@ Gets a vertex attribute included in this mesh buffer.
6565
#### Return Value
6666

6767
A vertex buffer accessor, or null
68-
if the attribute doesn't exist. (Type: H3DU.BufferAccessor)
68+
if the attribute doesn't exist. (Type: <a href="H3DU.BufferAccessor.md">H3DU.BufferAccessor</a>)
6969

7070
<a name='H3DU.MeshBuffer_getBounds'></a>
7171
### H3DU.MeshBuffer#getBounds()
@@ -185,7 +185,7 @@ ensures its values are each at least 3 elements long.
185185

186186
#### Return Value
187187

188-
This object. (Type: <a href="H3DU.Mesh.md">H3DU.Mesh</a>)
188+
This object. (Type: <a href="H3DU.MeshBuffer.md">H3DU.MeshBuffer</a>)
189189

190190
<a name='H3DU.MeshBuffer_reverseNormals'></a>
191191
### H3DU.MeshBuffer#reverseNormals()
@@ -308,6 +308,20 @@ Sets the type of graphics primitives stored in this mesh buffer.
308308

309309
This object. (Type: <a href="H3DU.MeshBuffer.md">H3DU.MeshBuffer</a>)
310310

311+
<a name='H3DU.MeshBuffer_toWireFrame'></a>
312+
### H3DU.MeshBuffer#toWireFrame()
313+
314+
<b>Deprecated: Included here for compatibility with <a href="H3DU.Mesh.md">H3DU.Mesh</a>.
315+
Use H3DU.MeshBuffer.wireFrame instead.</b>
316+
317+
Creates a new mesh with triangles converted
318+
to line segments.
319+
320+
#### Return Value
321+
322+
A new mesh with triangles converted
323+
to lines. (Type: <a href="H3DU.MeshBuffer.md">H3DU.MeshBuffer</a>)
324+
311325
<a name='H3DU.MeshBuffer_transform'></a>
312326
### H3DU.MeshBuffer#transform(matrix)
313327

@@ -353,10 +367,11 @@ The parameter "ret". (Type: Array.&lt;number>)
353367
<a name='H3DU.MeshBuffer_wireFrame'></a>
354368
### H3DU.MeshBuffer#wireFrame()
355369

356-
TODO: Not documented yet.
370+
Converts the triangles in this mesh to line segments.
371+
Has no effect if this mesh doesn't use triangles as primitives.
357372

358373
#### Return Value
359374

360-
Return value. (Type: *)
375+
This object. (Type: <a href="H3DU.MeshBuffer.md">H3DU.MeshBuffer</a>)
361376

362377
[Back to documentation index.](index.md)

0 commit comments

Comments
 (0)