2
0

QuadraticBezierCurve.html 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="utf-8" />
  5. <base href="../../../../" />
  6. <script src="page.js"></script>
  7. <link type="text/css" rel="stylesheet" href="page.css" />
  8. </head>
  9. <body>
  10. [page:Curve] &rarr;
  11. <h1>[name]</h1>
  12. <p class="desc">
  13. Create a smooth 2d
  14. <a href="http://en.wikipedia.org/wiki/B%C3%A9zier_curve#mediaviewer/File:B%C3%A9zier_2_big.gif" target="_blank">quadratic bezier curve</a>,
  15. defined by a startpoint, endpoint and a single control point.
  16. </p>
  17. <h2>Code Example</h2>
  18. <code>
  19. const curve = new THREE.QuadraticBezierCurve(
  20. new THREE.Vector2( -10, 0 ),
  21. new THREE.Vector2( 20, 15 ),
  22. new THREE.Vector2( 10, 0 )
  23. );
  24. const points = curve.getPoints( 50 );
  25. const geometry = new THREE.BufferGeometry().setFromPoints( points );
  26. const material = new THREE.LineBasicMaterial( { color : 0xff0000 } );
  27. // Create the final object to add to the scene
  28. const curveObject = new THREE.Line( geometry, material );
  29. </code>
  30. <h2>Constructor</h2>
  31. <h3>[name]( [param:Vector2 v0], [param:Vector2 v1], [param:Vector2 v2] )</h3>
  32. <p>
  33. [page:Vector2 v0] – The startpoint.<br/>
  34. [page:Vector2 v1] – The control point.<br/>
  35. [page:Vector2 v2] – The endpoint.
  36. </p>
  37. <h2>Properties</h2>
  38. <p>See the base [page:Curve] class for common properties.</p>
  39. <h3>[property:Vector2 v0]</h3>
  40. <p>The startpoint.</p>
  41. <h3>[property:Vector2 v1]</h3>
  42. <p>The control point.</p>
  43. <h3>[property:Vector2 v2]</h3>
  44. <p>The endpoint.</p>
  45. <h2>Methods</h2>
  46. <p>See the base [page:Curve] class for common methods.</p>
  47. <h2>Source</h2>
  48. <p>
  49. [link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]
  50. </p>
  51. </body>
  52. </html>