PolyhedronGeometry.html 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="utf-8" />
  5. <script src="../../../list.js"></script>
  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. <div 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. This class is used
  15. by [page:DodecahedronGeometry], [page:IcosahedronGeometry], [page:OctahedronGeometry],
  16. and [page:TetrahedronGeometry] to generate their respective geometries.
  17. </div>
  18. <h2>Example</h2>
  19. <code>
  20. var verticesOfCube = [
  21. -1,-1,-1, 1,-1,-1, 1, 1,-1, -1, 1,-1,
  22. -1,-1, 1, 1,-1, 1, 1, 1, 1, -1, 1, 1,
  23. ];
  24. var indicesOfFaces = [
  25. 2,1,0, 0,3,2,
  26. 0,4,7, 7,3,0,
  27. 0,1,5, 5,4,0,
  28. 1,2,6, 6,5,1,
  29. 2,3,7, 7,6,2,
  30. 4,5,6, 6,7,4
  31. ];
  32. var geometry = new THREE.PolyhedronGeometry( verticesOfCube, indicesOfFaces, 6, 2 );
  33. </code>
  34. <h2>Constructor</h2>
  35. <h3>[name]([page:Array vertices], [page:Array faces], [page:Float radius], [page:Integer detail])</h3>
  36. <div>
  37. vertices — [page:Array] of points of the form [1,1,1, -1,-1,-1, ... ] <br />
  38. faces — [page:Array] of indices that make up the faces of the form [0,1,2, 2,3,0, ... ] <br />
  39. radius — [page:Float] - The radius of the final shape <br />
  40. detail — [page:Integer] - How many levels to subdivide the geometry. The more detail, the smoother the shape.
  41. </div>
  42. <h2>Properties</h2>
  43. <h3>[property:Object parameters]</h3>
  44. <div>
  45. An object with all of the parameters that were used to generate the geometry.
  46. </div>
  47. <h2>Source</h2>
  48. [link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]
  49. </body>
  50. </html>