ConvexGeometry.html 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="utf-8" />
  5. <base href="../../../" />
  6. <script src="page.js"></script>
  7. <link type="text/css" rel="stylesheet" href="page.css" />
  8. </head>
  9. <body>
  10. [page:BufferGeometry] &rarr;
  11. <h1>[name]</h1>
  12. <p class="desc">[name] can be used to generate a convex hull for a given array of 3D points.
  13. The average time complexity for this task is considered to be O(nlog(n)).</p>
  14. <h2>Code Example</h2>
  15. <code>const geometry = new ConvexGeometry( points );
  16. const material = new THREE.MeshBasicMaterial( { color: 0x00ff00 } );
  17. const mesh = new THREE.Mesh( geometry, material );
  18. scene.add( mesh );
  19. </code>
  20. <h2>Examples</h2>
  21. <p>[example:webgl_geometry_convex geometry / convex ]</p>
  22. <h2>Constructor</h2>
  23. <h3>[name]( [param:Array points] )</h3>
  24. <p>
  25. points — Array of [page:Vector3 Vector3s] that the resulting convex hull will contain.
  26. </p>
  27. <h2>Source</h2>
  28. <p>
  29. [link:https://github.com/mrdoob/three.js/blob/master/examples/jsm/geometries/ConvexGeometry.js examples/jsm/geometries/ConvexGeometry.js]
  30. </p>
  31. </body>
  32. </html>