Draw Mode Constants

These are valid values for Mesh.drawMode, and control how the list of vertices is interpeted once sent to the GPU.

Note that these only work when Mesh.geometry is a BufferGeometry. Changing this when Mesh.geometry is a Geometry will have no effect.

Draw Modes


This is the default, and results in every three consecutive vertices (v0, v1, v2), (v2, v3, v5), ... being interpreted as a separate triangle.
If the number of vertices is not a multiple of 3, excess vertices are ignored.


This will result in a series of triangles connected in a strip, given by (v0, v1, v2), (v2, v1, v3), (v2, v3, v4), ... so that every subsequent triangle shares two vertices with the previous triangle.


This will result in a series of triangles each sharing the first vertex (like a fan), given by (v0, v1, v2), (v0, v2, v3), (v0, v3, v4), ...

Note: As of DirectX10, this mode is not supported. As Chrome and Firefox render WebGL using ANGLE on Windows, internally this mode will be converted to a supported mode, which will likely lead to lowered performance on those browsers.


var geometry = new v3d.Geometry(); geometry.vertices.push( new v3d.Vector3(-10, 10, 0), new v3d.Vector3(-10, -10, 0), new v3d.Vector3( 10, -10, 0), ... ); geometry.faces.push(new v3d.Face3(0, 1, 2), ...); var material = new v3d.MeshBasicMaterial({ color: 0xffff00 }); var mesh = new v3d.Mesh(geometry, material); mesh.drawMode = v3d.TrianglesDrawMode; //default scene.add(mesh);


For more info on how to obtain the source code of this module see this page.