ConvexBufferGeometry.html 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="utf-8" />
  5. <base href="../../../" />
  6. <script src="list.js"></script>
  7. <script src="page.js"></script>
  8. <script src="page.js"></script>
  9. <link type="text/css" rel="stylesheet" href="page.css" />
  10. </head>
  11. <body>
  12. [page:BufferGeometry] &rarr;
  13. <h1>[name]</h1>
  14. <p class="desc">[name] can be used to generate a convex hull for a given array of 3D points.
  15. The average time complexity for this task is considered to be O(nlog(n)).</p>
  16. <script>
  17. // iOS iframe auto-resize workaround
  18. if ( /(iPad|iPhone|iPod)/g.test( navigator.userAgent ) ) {
  19. var scene = document.getElementById( 'scene' );
  20. scene.style.width = getComputedStyle( scene ).width;
  21. scene.style.height = getComputedStyle( scene ).height;
  22. scene.setAttribute( 'scrolling', 'no' );
  23. }
  24. </script>
  25. <h2>Example</h2>
  26. <p>[example:webgl_geometry_convex geometry / convex ]</p>
  27. <code>var geometry = new THREE.ConvexBufferGeometry( points );
  28. var material = new THREE.MeshBasicMaterial( {color: 0x00ff00} );
  29. var mesh = new THREE.Mesh( geometry, material );
  30. scene.add( mesh );
  31. </code>
  32. <h2>Constructor</h2>
  33. <h3>[name]( [param:Array points] )</h3>
  34. <p>
  35. points — Array of [page:Vector3 Vector3s] that the resulting convex hull will contain.
  36. </p>
  37. <h2>Source</h2>
  38. <p>
  39. [link:https://github.com/mrdoob/three.js/blob/master/examples/js/geometries/ConvexGeometry.js examples/js/geometries/ConvexGeometry.js]
  40. </p>
  41. </body>
  42. </html>