QuadraticBezierCurve.html 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="utf-8">
  5. <title>QuadraticBezierCurve - 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="Curve.html">Curve</a> → </p>
  13. <h1 translate="no">QuadraticBezierCurve</h1>
  14. <section>
  15. <header>
  16. <div class="class-description"><p>A curve representing a 2D Quadratic Bezier curve.</p></div>
  17. <h2>Code Example</h2>
  18. <div translate="no"><pre><code class="language-js">const curve = new THREE.QuadraticBezierCurve(
  19. new THREE.Vector2( - 10, 0 ),
  20. new THREE.Vector2( 20, 15 ),
  21. new THREE.Vector2( 10, 0 )
  22. )
  23. const points = curve.getPoints( 50 );
  24. const geometry = new THREE.BufferGeometry().setFromPoints( points );
  25. const material = new THREE.LineBasicMaterial( { color: 0xff0000 } );
  26. // Create the final object to add to the scene
  27. const curveObject = new THREE.Line( geometry, material );
  28. </code></pre></div>
  29. </header>
  30. <article>
  31. <div class="container-overview">
  32. <h2>Constructor</h2>
  33. <h3 class="name name-method" id="QuadraticBezierCurve" translate="no">new <a href="#QuadraticBezierCurve">QuadraticBezierCurve</a><span class="signature">( v0 : <span class="param-type"><a href="Vector2.html">Vector2</a></span>, v1 : <span class="param-type"><a href="Vector2.html">Vector2</a></span>, v2 : <span class="param-type"><a href="Vector2.html">Vector2</a></span> )</span> </h3>
  34. <div class="method">
  35. <div class="description">
  36. <p>Constructs a new Quadratic Bezier curve.</p>
  37. </div>
  38. <table class="params">
  39. <tbody>
  40. <tr>
  41. <td class="name">
  42. <strong>v0</strong>
  43. </td>
  44. <td class="description last">
  45. <p>The start point.</p>
  46. </td>
  47. </tr>
  48. <tr>
  49. <td class="name">
  50. <strong>v1</strong>
  51. </td>
  52. <td class="description last">
  53. <p>The control point.</p>
  54. </td>
  55. </tr>
  56. <tr>
  57. <td class="name">
  58. <strong>v2</strong>
  59. </td>
  60. <td class="description last">
  61. <p>The end point.</p>
  62. </td>
  63. </tr>
  64. </tbody>
  65. </table>
  66. </div>
  67. </div>
  68. <h2 class="subsection-title">Properties</h2>
  69. <div class="member">
  70. <h3 class="name" id="isQuadraticBezierCurve" translate="no">.<a href="#isQuadraticBezierCurve">isQuadraticBezierCurve</a><span class="type-signature"> : boolean</span> <span class="type-signature">(readonly) </span></h3>
  71. <div class="description">
  72. <p>This flag can be used for type testing.</p>
  73. <p>Default is <code>true</code>.</p>
  74. </div>
  75. </div>
  76. <div class="member">
  77. <h3 class="name" id="v0" translate="no">.<a href="#v0">v0</a><span class="type-signature"> : <a href="Vector2.html">Vector2</a></span> </h3>
  78. <div class="description">
  79. <p>The start point.</p>
  80. </div>
  81. </div>
  82. <div class="member">
  83. <h3 class="name" id="v1" translate="no">.<a href="#v1">v1</a><span class="type-signature"> : <a href="Vector2.html">Vector2</a></span> </h3>
  84. <div class="description">
  85. <p>The control point.</p>
  86. </div>
  87. </div>
  88. <div class="member">
  89. <h3 class="name" id="v2" translate="no">.<a href="#v2">v2</a><span class="type-signature"> : <a href="Vector2.html">Vector2</a></span> </h3>
  90. <div class="description">
  91. <p>The end point.</p>
  92. </div>
  93. </div>
  94. <h2 class="subsection-title">Methods</h2>
  95. <h3 class="name name-method" id="getPoint" translate="no">.<a href="#getPoint">getPoint</a><span class="signature">( t : <span class="param-type">number</span>, optionalTarget : <span class="param-type"><a href="Vector2.html">Vector2</a></span> )</span><span class="type-signature"> : <a href="Vector2.html">Vector2</a></span> </h3>
  96. <div class="method">
  97. <div class="description">
  98. <p>Returns a point on the curve.</p>
  99. </div>
  100. <table class="params">
  101. <tbody>
  102. <tr>
  103. <td class="name">
  104. <strong>t</strong>
  105. </td>
  106. <td class="description last">
  107. <p>A interpolation factor representing a position on the curve. Must be in the range <code>[0,1]</code>.</p>
  108. </td>
  109. </tr>
  110. <tr>
  111. <td class="name">
  112. <strong>optionalTarget</strong>
  113. </td>
  114. <td class="description last">
  115. <p>The optional target vector the result is written to.</p>
  116. </td>
  117. </tr>
  118. </tbody>
  119. </table>
  120. <dl class="details">
  121. <dt class="tag-overrides"><strong>Overrides:</strong> <a href="Curve.html#getPoint">Curve#getPoint</a></dt>
  122. </dl>
  123. <dl class="details">
  124. <dt class="tag-returns"><strong>Returns:</strong> The position on the curve.</dt>
  125. </dl>
  126. </div>
  127. <h2 class="subsection-title">Source</h2>
  128. <p>
  129. <a href="https://github.com/mrdoob/three.js/blob/master/src/extras/curves/QuadraticBezierCurve.js" translate="no" target="_blank" rel="noopener">src/extras/curves/QuadraticBezierCurve.js</a>
  130. </p>
  131. </article>
  132. </section>
  133. <script src="../scripts/linenumber.js"></script>
  134. <script src="../scripts/page.js"></script>
  135. </body>
  136. </html>
粤ICP备19079148号