PolyhedronGeometry.html 1.9 KB

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