OctahedronGeometry.html 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="utf-8">
  5. <title>OctahedronGeometry - Three.js Docs</title>
  6. <meta name="viewport" content="width=device-width, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0">
  7. <script src="../scripts/highlight.min.js"></script>
  8. <link type="text/css" rel="stylesheet" href="../styles/highlight-three.css">
  9. <link type="text/css" rel="stylesheet" href="../styles/page.css">
  10. </head>
  11. <body>
  12. <p class="inheritance" translate="no"><a href="EventDispatcher.html">EventDispatcher</a> → <a href="BufferGeometry.html">BufferGeometry</a> → <a href="PolyhedronGeometry.html">PolyhedronGeometry</a> → </p>
  13. <h1 translate="no">OctahedronGeometry</h1>
  14. <section>
  15. <header>
  16. <div class="class-description"><p>A geometry class for representing an octahedron.</p></div>
  17. <iframe id="viewer" src="../scenes/geometry-browser.html#OctahedronGeometry"></iframe>
  18. <h2>Code Example</h2>
  19. <div translate="no"><pre><code class="language-js">const geometry = new THREE.OctahedronGeometry();
  20. const material = new THREE.MeshBasicMaterial( { color: 0xffff00 } );
  21. const octahedron = new THREE.Mesh( geometry, material );
  22. scene.add( octahedron );
  23. </code></pre></div>
  24. </header>
  25. <article>
  26. <div class="container-overview">
  27. <h2>Constructor</h2>
  28. <h3 class="name name-method" id="OctahedronGeometry" translate="no">new <a href="#OctahedronGeometry">OctahedronGeometry</a><span class="signature">( radius : <span class="param-type">number</span>, detail : <span class="param-type">number</span> )</span> </h3>
  29. <div class="method">
  30. <div class="description">
  31. <p>Constructs a new octahedron geometry.</p>
  32. </div>
  33. <table class="params">
  34. <tbody>
  35. <tr>
  36. <td class="name">
  37. <strong>radius</strong>
  38. </td>
  39. <td class="description last">
  40. <p>Radius of the octahedron.</p>
  41. <p>Default is <code>1</code>.</p>
  42. </td>
  43. </tr>
  44. <tr>
  45. <td class="name">
  46. <strong>detail</strong>
  47. </td>
  48. <td class="description last">
  49. <p>Setting this to a value greater than <code>0</code> adds vertices making it no longer a octahedron.</p>
  50. <p>Default is <code>0</code>.</p>
  51. </td>
  52. </tr>
  53. </tbody>
  54. </table>
  55. </div>
  56. </div>
  57. <h2 class="subsection-title">Properties</h2>
  58. <div class="member">
  59. <h3 class="name" id="parameters" translate="no">.<a href="#parameters">parameters</a><span class="type-signature"> : Object</span> </h3>
  60. <div class="description">
  61. <p>Holds the constructor parameters that have been
  62. used to generate the geometry. Any modification
  63. after instantiation does not change the geometry.</p>
  64. </div>
  65. <dl class="details">
  66. <dt class="tag-overrides"><strong>Overrides:</strong> <a href="PolyhedronGeometry.html#parameters">PolyhedronGeometry#parameters</a></dt>
  67. </dl>
  68. </div>
  69. <h2 class="subsection-title">Static Methods</h2>
  70. <h3 class="name name-method" id=".fromJSON" translate="no">.<a href="#.fromJSON">fromJSON</a><span class="signature">( data : <span class="param-type">Object</span> )</span><span class="type-signature"> : <a href="OctahedronGeometry.html">OctahedronGeometry</a></span> </h3>
  71. <div class="method">
  72. <div class="description">
  73. <p>Factory method for creating an instance of this class from the given
  74. JSON object.</p>
  75. </div>
  76. <table class="params">
  77. <tbody>
  78. <tr>
  79. <td class="name">
  80. <strong>data</strong>
  81. </td>
  82. <td class="description last">
  83. <p>A JSON object representing the serialized geometry.</p>
  84. </td>
  85. </tr>
  86. </tbody>
  87. </table>
  88. <dl class="details">
  89. <dt class="tag-returns"><strong>Returns:</strong> A new instance.</dt>
  90. </dl>
  91. </div>
  92. <h2 class="subsection-title">Source</h2>
  93. <p>
  94. <a href="https://github.com/mrdoob/three.js/blob/master/src/geometries/OctahedronGeometry.js" translate="no" target="_blank" rel="noopener">src/geometries/OctahedronGeometry.js</a>
  95. </p>
  96. </article>
  97. </section>
  98. <script src="../scripts/linenumber.js"></script>
  99. <script src="../scripts/page.js"></script>
  100. </body>
  101. </html>
粤ICP备19079148号