|
@@ -1,79 +0,0 @@
|
|
|
-<!DOCTYPE html>
|
|
|
-<html lang="en">
|
|
|
- <head>
|
|
|
- <meta charset="utf-8" />
|
|
|
- <base href="../../../" />
|
|
|
- <script src="list.js"></script>
|
|
|
- <script src="page.js"></script>
|
|
|
- <link type="text/css" rel="stylesheet" href="page.css" />
|
|
|
- </head>
|
|
|
- <body>
|
|
|
- <h1>Draw Mode Constants</h1>
|
|
|
-
|
|
|
- <p class="desc">
|
|
|
- These are valid values for [page:Mesh.drawMode], and control how the list of vertices is interpeted once sent to the GPU.
|
|
|
- </p>
|
|
|
-
|
|
|
- <h2>Draw Modes</h2>
|
|
|
-
|
|
|
- <code>
|
|
|
- THREE.TrianglesDrawMode
|
|
|
- </code>
|
|
|
- <p>
|
|
|
- This is the default, and results in every three consecutive vertices (v0, v1, v2), (v3, v4, v5), ...
|
|
|
- being interpreted as a separate triangle. <br />
|
|
|
- If the number of vertices is not a multiple of 3, excess vertices are ignored.
|
|
|
- </p>
|
|
|
-
|
|
|
- <code>
|
|
|
- THREE.TriangleStripDrawMode
|
|
|
- </code>
|
|
|
- <p>
|
|
|
- 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.
|
|
|
- </p>
|
|
|
-
|
|
|
- <code>
|
|
|
- THREE.TriangleFanDrawMode
|
|
|
- </code>
|
|
|
- <p>
|
|
|
- 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), ... <br /><br />
|
|
|
-
|
|
|
- <em>Note:</em> As of [link:https://en.wikipedia.org/wiki/DirectX#DirectX_10 DirectX10], this mode is not supported. As Chrome and Firefox
|
|
|
- render WebGL using [link:https://en.wikipedia.org/wiki/ANGLE_(software) ANGLE] on Windows,
|
|
|
- internally this mode will be converted to a supported mode, which will likely lead to lowered
|
|
|
- performance on those browsers.
|
|
|
- </p>
|
|
|
-
|
|
|
-
|
|
|
- <h2>Usage</h2>
|
|
|
-
|
|
|
- <code>
|
|
|
- var geometry = new THREE.BufferGeometry();
|
|
|
-
|
|
|
- var vertices = [];
|
|
|
-
|
|
|
- vertices.push( -10, 10, 0 );
|
|
|
- vertices.push( -10, -10, 0 );
|
|
|
- vertices.push( 10, -10, 0 );
|
|
|
-
|
|
|
- // ...
|
|
|
-
|
|
|
- geometry.setAttribute( 'position', new THREE.Float32BufferAttribute( vertices, 3 ) );
|
|
|
-
|
|
|
- var material = new THREE.MeshBasicMaterial( { color: 0xffff00 } );
|
|
|
-
|
|
|
- var mesh = new THREE.Mesh( geometry, material );
|
|
|
- mesh.setDrawMode( THREE.TrianglesDrawMode ); //default
|
|
|
-
|
|
|
- scene.add( mesh );
|
|
|
- </code>
|
|
|
-
|
|
|
- <h2>Source</h2>
|
|
|
-
|
|
|
- <p>
|
|
|
- [link:https://github.com/mrdoob/three.js/blob/master/src/constants.js src/constants.js]
|
|
|
- </p>
|
|
|
- </body>
|
|
|
-</html>
|