Flow.html 3.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="utf-8">
  5. <title>Flow - 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. <h1 translate="no">Flow</h1>
  13. <section>
  14. <header>
  15. <div class="class-description"><p>A modifier for making meshes bend around curves.</p>
  16. <p>This module can only be used with <a href="WebGLRenderer.html">WebGLRenderer</a>. When using <a href="WebGPURenderer.html">WebGPURenderer</a>,
  17. import the class from <code>CurveModifierGPU.js</code>.</p></div>
  18. </header>
  19. <article>
  20. <h2 class="subsection-title">Import</h2>
  21. <p><span translate="no">Flow</span> is an addon, and must be imported explicitly, see <a href="https://threejs.org/manual/#en/installation" target="_blank">Installation#Addons</a>.</p>
  22. <pre><code class="language-js">import { Flow } from 'three/addons/modifiers/CurveModifier.js';</code></pre>
  23. <div class="container-overview">
  24. <h2>Constructor</h2>
  25. <h3 class="name name-method" id="Flow" translate="no">new <a href="#Flow">Flow</a><span class="signature">( mesh : <span class="param-type">Mesh</span>, numberOfCurves : <span class="param-type">number</span> )</span> </h3>
  26. <div class="method">
  27. <div class="description">
  28. <p>Constructs a new Flow instance.</p>
  29. </div>
  30. <table class="params">
  31. <tbody>
  32. <tr>
  33. <td class="name"><code>mesh</code></td>
  34. <td class="description last"><p>The mesh to clone and modify to bend around the curve.</p></td>
  35. </tr>
  36. <tr>
  37. <td class="name"><code>numberOfCurves</code></td>
  38. <td class="description last"><p>The amount of space that should preallocated for additional curves.<br/>Default is <code>1</code>.</p></td>
  39. </tr>
  40. </tbody>
  41. </table>
  42. </div>
  43. </div>
  44. <h2 class="subsection-title">Classes</h2>
  45. <dl>
  46. <dt><a href="Flow.html">Flow</a></dt>
  47. <dd></dd>
  48. </dl>
  49. <h2 class="subsection-title">Methods</h2>
  50. <h3 class="name name-method" id="moveAlongCurve" translate="no">.<a href="#moveAlongCurve">moveAlongCurve</a><span class="signature">( amount : <span class="param-type">number</span> )</span> </h3>
  51. <div class="method">
  52. <div class="description">
  53. <p>Moves the mesh along the curve.</p>
  54. </div>
  55. <table class="params">
  56. <tbody>
  57. <tr>
  58. <td class="name"><code>amount</code></td>
  59. <td class="description last"><p>The offset.</p></td>
  60. </tr>
  61. </tbody>
  62. </table>
  63. </div>
  64. <h3 class="name name-method" id="updateCurve" translate="no">.<a href="#updateCurve">updateCurve</a><span class="signature">( index : <span class="param-type">number</span>, curve : <span class="param-type">Curve</span> )</span> </h3>
  65. <div class="method">
  66. <div class="description">
  67. <p>Updates the curve for the given curve index.</p>
  68. </div>
  69. <table class="params">
  70. <tbody>
  71. <tr>
  72. <td class="name"><code>index</code></td>
  73. <td class="description last"><p>The curve index.</p></td>
  74. </tr>
  75. <tr>
  76. <td class="name"><code>curve</code></td>
  77. <td class="description last"><p>The curve that should be used to bend the mesh.</p></td>
  78. </tr>
  79. </tbody>
  80. </table>
  81. </div>
  82. <h2 class="subsection-title">Source</h2>
  83. <p>
  84. <a href="https://github.com/mrdoob/three.js/blob/master/examples/jsm/modifiers/CurveModifier.js" target="_blank" rel="noopener" translate="no">examples/jsm/modifiers/CurveModifier.js</a>
  85. </p>
  86. </article>
  87. </section>
  88. <script src="../scripts/linenumber.js"></script>
  89. <script src="../scripts/page.js"></script>
  90. </body>
  91. </html>
粤ICP备19079148号