InstancedFlow.html 5.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="utf-8">
  5. <title>InstancedFlow - 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="Flow.html">Flow</a> → </p>
  13. <h1 translate="no">InstancedFlow</h1>
  14. <section>
  15. <header>
  16. <div class="class-description"><p>An instanced version of <a href="Flow.html">Flow</a> for making meshes bend around curves, where the instances are placed on the curve.</p>
  17. <p>This module can only be used with <a href="WebGLRenderer.html">WebGLRenderer</a>.</p></div>
  18. </header>
  19. <article>
  20. <h2 class="subsection-title">Import</h2>
  21. <p><span translate="no">InstancedFlow</span> is an addon, and must be imported explicitly, see <a href="https://threejs.org/manual/#en/installation" target="_blank" rel="noopener">Installation#Addons</a>.</p>
  22. <pre><code class="language-js">import { InstancedFlow } from 'three/addons/modifiers/CurveModifier.js';</code></pre>
  23. <div class="container-overview">
  24. <h2>Constructor</h2>
  25. <h3 class="name name-method" id="InstancedFlow" translate="no">new <a href="#InstancedFlow">InstancedFlow</a><span class="signature">( count : <span class="param-type">number</span>, curveCount : <span class="param-type">number</span>, geometry : <span class="param-type">Geometry</span>, material : <span class="param-type"><a href="Material.html">Material</a></span> )</span> </h3>
  26. <div class="method">
  27. <div class="description">
  28. <p>Constructs a new InstancedFlow instance.</p>
  29. </div>
  30. <table class="params">
  31. <tbody>
  32. <tr>
  33. <td class="name">
  34. <strong>count</strong>
  35. </td>
  36. <td class="description last">
  37. <p>The number of instanced elements.</p>
  38. </td>
  39. </tr>
  40. <tr>
  41. <td class="name">
  42. <strong>curveCount</strong>
  43. </td>
  44. <td class="description last">
  45. <p>The number of curves to preallocate for.</p>
  46. </td>
  47. </tr>
  48. <tr>
  49. <td class="name">
  50. <strong>geometry</strong>
  51. </td>
  52. <td class="description last">
  53. <p>The geometry to use for the instanced mesh.</p>
  54. </td>
  55. </tr>
  56. <tr>
  57. <td class="name">
  58. <strong>material</strong>
  59. </td>
  60. <td class="description last">
  61. <p>The material to use for the instanced mesh.</p>
  62. </td>
  63. </tr>
  64. </tbody>
  65. </table>
  66. </div>
  67. </div>
  68. <h2 class="subsection-title">Classes</h2>
  69. <dl>
  70. <dt><a href="InstancedFlow.html">InstancedFlow</a></dt>
  71. <dd></dd>
  72. </dl>
  73. <h2 class="subsection-title">Methods</h2>
  74. <h3 class="name name-method" id="moveIndividualAlongCurve" translate="no">.<a href="#moveIndividualAlongCurve">moveIndividualAlongCurve</a><span class="signature">( index : <span class="param-type">number</span>, offset : <span class="param-type">number</span> )</span> </h3>
  75. <div class="method">
  76. <div class="description">
  77. <p>Move an individual element along the curve by a specific amount.</p>
  78. </div>
  79. <table class="params">
  80. <tbody>
  81. <tr>
  82. <td class="name">
  83. <strong>index</strong>
  84. </td>
  85. <td class="description last">
  86. <p>Which element to update.</p>
  87. </td>
  88. </tr>
  89. <tr>
  90. <td class="name">
  91. <strong>offset</strong>
  92. </td>
  93. <td class="description last">
  94. <p>The offset.</p>
  95. </td>
  96. </tr>
  97. </tbody>
  98. </table>
  99. </div>
  100. <h3 class="name name-method" id="setCurve" translate="no">.<a href="#setCurve">setCurve</a><span class="signature">( index : <span class="param-type">number</span>, curveNo : <span class="param-type">number</span> )</span> </h3>
  101. <div class="method">
  102. <div class="description">
  103. <p>Select which curve to use for an element.</p>
  104. </div>
  105. <table class="params">
  106. <tbody>
  107. <tr>
  108. <td class="name">
  109. <strong>index</strong>
  110. </td>
  111. <td class="description last">
  112. <p>The index of the instanced element to update.</p>
  113. </td>
  114. </tr>
  115. <tr>
  116. <td class="name">
  117. <strong>curveNo</strong>
  118. </td>
  119. <td class="description last">
  120. <p>The index of the curve it should use.</p>
  121. </td>
  122. </tr>
  123. </tbody>
  124. </table>
  125. </div>
  126. <h3 class="name name-method" id="writeChanges" translate="no">.<a href="#writeChanges">writeChanges</a><span class="signature">( index : <span class="param-type">number</span> )</span> </h3>
  127. <div class="method">
  128. <div class="description">
  129. <p>The extra information about which curve and curve position is stored in the translation components of the matrix for the instanced objects
  130. This writes that information to the matrix and marks it as needing update.</p>
  131. </div>
  132. <table class="params">
  133. <tbody>
  134. <tr>
  135. <td class="name">
  136. <strong>index</strong>
  137. </td>
  138. <td class="description last">
  139. <p>The index of tge instanced element to update.</p>
  140. </td>
  141. </tr>
  142. </tbody>
  143. </table>
  144. </div>
  145. <h2 class="subsection-title">Source</h2>
  146. <p>
  147. <a href="https://github.com/mrdoob/three.js/blob/master/examples/jsm/modifiers/CurveModifier.js" translate="no" target="_blank" rel="noopener">examples/jsm/modifiers/CurveModifier.js</a>
  148. </p>
  149. </article>
  150. </section>
  151. <script src="../scripts/linenumber.js"></script>
  152. <script src="../scripts/page.js"></script>
  153. </body>
  154. </html>
粤ICP备19079148号