2
0

PolyhedronGeometry.html 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  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:Geometry] &rarr;
  11. <h1>[name]</h1>
  12. <p class="desc">
  13. A polyhedron is a solid in three dimensions with flat faces. This class will take an array of vertices,
  14. project them onto a sphere, and then divide them up to the desired level of detail.
  15. </p>
  16. <h2>Code Example</h2>
  17. <code>
  18. const verticesOfCube = [
  19. -1,-1,-1, 1,-1,-1, 1, 1,-1, -1, 1,-1,
  20. -1,-1, 1, 1,-1, 1, 1, 1, 1, -1, 1, 1,
  21. ];
  22. const indicesOfFaces = [
  23. 2,1,0, 0,3,2,
  24. 0,4,7, 7,3,0,
  25. 0,1,5, 5,4,0,
  26. 1,2,6, 6,5,1,
  27. 2,3,7, 7,6,2,
  28. 4,5,6, 6,7,4
  29. ];
  30. const geometry = new THREE.PolyhedronGeometry( verticesOfCube, indicesOfFaces, 6, 2 );
  31. </code>
  32. <h2>Constructor</h2>
  33. <h3>[name]([param:Array vertices], [param:Array indices], [param:Float radius], [param:Integer detail])</h3>
  34. <p>
  35. vertices — [page:Array] of points of the form [1,1,1, -1,-1,-1, ... ] <br />
  36. indices — [page:Array] of indices that make up the faces of the form [0,1,2, 2,3,0, ... ] <br />
  37. radius — [page:Float] - The radius of the final shape <br />
  38. detail — [page:Integer] - How many levels to subdivide the geometry. The more detail, the smoother the shape.
  39. </p>
  40. <h2>Properties</h2>
  41. <p>See the base [page:Geometry] class for common properties.</p>
  42. <h3>[property:Object parameters]</h3>
  43. <p>
  44. An object with a property for each of the constructor parameters. Any modification after instantiation does not change the geometry.
  45. </p>
  46. <h2>Methods</h2>
  47. <p>See the base [page:Geometry] class for common methods.</p>
  48. <h2>Source</h2>
  49. <p>
  50. [link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]
  51. </p>
  52. </body>
  53. </html>