PolyhedronGeometry.html 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  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. <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>Source</h2>
  47. [link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]
  48. </body>
  49. </html>