PolyhedronBufferGeometry.html 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  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:BufferGeometry] &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. This class is used
  16. by [page:DodecahedronBufferGeometry], [page:IcosahedronBufferGeometry], [page:OctahedronBufferGeometry],
  17. and [page:TetrahedronBufferGeometry] to generate their respective geometries.
  18. </p>
  19. <h2>Example</h2>
  20. <code>
  21. var verticesOfCube = [
  22. -1,-1,-1, 1,-1,-1, 1, 1,-1, -1, 1,-1,
  23. -1,-1, 1, 1,-1, 1, 1, 1, 1, -1, 1, 1,
  24. ];
  25. var indicesOfFaces = [
  26. 2,1,0, 0,3,2,
  27. 0,4,7, 7,3,0,
  28. 0,1,5, 5,4,0,
  29. 1,2,6, 6,5,1,
  30. 2,3,7, 7,6,2,
  31. 4,5,6, 6,7,4
  32. ];
  33. var geometry = new THREE.PolyhedronBufferGeometry( verticesOfCube, indicesOfFaces, 6, 2 );
  34. </code>
  35. <h2>Constructor</h2>
  36. <h3>[name]([param:Array vertices], [param:Array indices], [param:Float radius], [param:Integer detail])</h3>
  37. <p>
  38. vertices — [page:Array] of points of the form [1,1,1, -1,-1,-1, ... ] <br />
  39. indices — [page:Array] of indices that make up the faces of the form [0,1,2, 2,3,0, ... ] <br />
  40. radius — [page:Float] - The radius of the final shape <br />
  41. detail — [page:Integer] - How many levels to subdivide the geometry. The more detail, the smoother the shape.
  42. </p>
  43. <h2>Properties</h2>
  44. <h3>[property:Object parameters]</h3>
  45. <p>
  46. An object with a property for each of the constructor parameters. Any modification after instantiation does not change the geometry.
  47. </p>
  48. <h2>Source</h2>
  49. [link:https://github.com/mrdoob/three.js/blob/master/src/geometries/PolyhedronGeometry.js src/geometries/PolyhedronGeometry.js]
  50. </body>
  51. </html>