RingGeometry.html 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="utf-8">
  5. <title>RingGeometry - 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> → </p>
  13. <h1 translate="no">RingGeometry</h1>
  14. <section>
  15. <header>
  16. <div class="class-description"><p>A class for generating a two-dimensional ring geometry.</p></div>
  17. <iframe id="viewer" src="../scenes/geometry-browser.html#RingGeometry"></iframe>
  18. <h2>Code Example</h2>
  19. <div translate="no"><pre><code class="language-js">const geometry = new THREE.RingGeometry( 1, 5, 32 );
  20. const material = new THREE.MeshBasicMaterial( { color: 0xffff00, side: THREE.DoubleSide } );
  21. const mesh = new THREE.Mesh( geometry, material );
  22. scene.add( mesh );
  23. </code></pre></div>
  24. </header>
  25. <article>
  26. <div class="container-overview">
  27. <h2>Constructor</h2>
  28. <h3 class="name name-method" id="RingGeometry" translate="no">new <a href="#RingGeometry">RingGeometry</a><span class="signature">( innerRadius : <span class="param-type">number</span>, outerRadius : <span class="param-type">number</span>, thetaSegments : <span class="param-type">number</span>, phiSegments : <span class="param-type">number</span>, thetaStart : <span class="param-type">number</span>, thetaLength : <span class="param-type">number</span> )</span> </h3>
  29. <div class="method">
  30. <div class="description">
  31. <p>Constructs a new ring geometry.</p>
  32. </div>
  33. <table class="params">
  34. <tbody>
  35. <tr>
  36. <td class="name">
  37. <strong>innerRadius</strong>
  38. </td>
  39. <td class="description last">
  40. <p>The inner radius of the ring.</p>
  41. <p>Default is <code>0.5</code>.</p>
  42. </td>
  43. </tr>
  44. <tr>
  45. <td class="name">
  46. <strong>outerRadius</strong>
  47. </td>
  48. <td class="description last">
  49. <p>The outer radius of the ring.</p>
  50. <p>Default is <code>1</code>.</p>
  51. </td>
  52. </tr>
  53. <tr>
  54. <td class="name">
  55. <strong>thetaSegments</strong>
  56. </td>
  57. <td class="description last">
  58. <p>Number of segments. A higher number means the ring will be more round. Minimum is <code>3</code>.</p>
  59. <p>Default is <code>32</code>.</p>
  60. </td>
  61. </tr>
  62. <tr>
  63. <td class="name">
  64. <strong>phiSegments</strong>
  65. </td>
  66. <td class="description last">
  67. <p>Number of segments per ring segment. Minimum is <code>1</code>.</p>
  68. <p>Default is <code>1</code>.</p>
  69. </td>
  70. </tr>
  71. <tr>
  72. <td class="name">
  73. <strong>thetaStart</strong>
  74. </td>
  75. <td class="description last">
  76. <p>Starting angle in radians.</p>
  77. <p>Default is <code>0</code>.</p>
  78. </td>
  79. </tr>
  80. <tr>
  81. <td class="name">
  82. <strong>thetaLength</strong>
  83. </td>
  84. <td class="description last">
  85. <p>Central angle in radians.</p>
  86. <p>Default is <code>Math.PI*2</code>.</p>
  87. </td>
  88. </tr>
  89. </tbody>
  90. </table>
  91. </div>
  92. </div>
  93. <h2 class="subsection-title">Properties</h2>
  94. <div class="member">
  95. <h3 class="name" id="parameters" translate="no">.<a href="#parameters">parameters</a><span class="type-signature"> : Object</span> </h3>
  96. <div class="description">
  97. <p>Holds the constructor parameters that have been
  98. used to generate the geometry. Any modification
  99. after instantiation does not change the geometry.</p>
  100. </div>
  101. </div>
  102. <h2 class="subsection-title">Static Methods</h2>
  103. <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="RingGeometry.html">RingGeometry</a></span> </h3>
  104. <div class="method">
  105. <div class="description">
  106. <p>Factory method for creating an instance of this class from the given
  107. JSON object.</p>
  108. </div>
  109. <table class="params">
  110. <tbody>
  111. <tr>
  112. <td class="name">
  113. <strong>data</strong>
  114. </td>
  115. <td class="description last">
  116. <p>A JSON object representing the serialized geometry.</p>
  117. </td>
  118. </tr>
  119. </tbody>
  120. </table>
  121. <dl class="details">
  122. <dt class="tag-returns"><strong>Returns:</strong> A new instance.</dt>
  123. </dl>
  124. </div>
  125. <h2 class="subsection-title">Source</h2>
  126. <p>
  127. <a href="https://github.com/mrdoob/three.js/blob/master/src/geometries/RingGeometry.js" translate="no" target="_blank" rel="noopener">src/geometries/RingGeometry.js</a>
  128. </p>
  129. </article>
  130. </section>
  131. <script src="../scripts/linenumber.js"></script>
  132. <script src="../scripts/page.js"></script>
  133. </body>
  134. </html>
粤ICP备19079148号