OctahedronGeometry.html 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  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"><code>radius</code></td>
  37. <td class="description last"><p>Radius of the octahedron.<br/>Default is <code>1</code>.</p></td>
  38. </tr>
  39. <tr>
  40. <td class="name"><code>detail</code></td>
  41. <td class="description last"><p>Setting this to a value greater than <code>0</code> adds vertices making it no longer a octahedron.<br/>Default is <code>0</code>.</p></td>
  42. </tr>
  43. </tbody>
  44. </table>
  45. </div>
  46. </div>
  47. <h2 class="subsection-title">Properties</h2>
  48. <div class="member">
  49. <h3 class="name" id="parameters" translate="no">.<a href="#parameters">parameters</a><span class="type-signature"> : Object</span> </h3>
  50. <div class="description">
  51. <p>Holds the constructor parameters that have been
  52. used to generate the geometry. Any modification
  53. after instantiation does not change the geometry.</p>
  54. </div>
  55. <dl class="details">
  56. <dt class="tag-overrides"><strong>Overrides:</strong> <a href="PolyhedronGeometry.html#parameters">PolyhedronGeometry#parameters</a></dt>
  57. </dl>
  58. </div>
  59. <h2 class="subsection-title">Static Methods</h2>
  60. <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>
  61. <div class="method">
  62. <div class="description">
  63. <p>Factory method for creating an instance of this class from the given
  64. JSON object.</p>
  65. </div>
  66. <table class="params">
  67. <tbody>
  68. <tr>
  69. <td class="name"><code>data</code></td>
  70. <td class="description last"><p>A JSON object representing the serialized geometry.</p></td>
  71. </tr>
  72. </tbody>
  73. </table>
  74. <dl class="details">
  75. <dt class="tag-returns"><strong>Returns:</strong> A new instance.</dt>
  76. </dl>
  77. </div>
  78. <h2 class="subsection-title">Source</h2>
  79. <p>
  80. <a href="https://github.com/mrdoob/three.js/blob/master/src/geometries/OctahedronGeometry.js" target="_blank" rel="noopener" translate="no">src/geometries/OctahedronGeometry.js</a>
  81. </p>
  82. </article>
  83. </section>
  84. <script src="../scripts/linenumber.js"></script>
  85. <script src="../scripts/page.js"></script>
  86. </body>
  87. </html>
粤ICP备19079148号