1
0

QuadraticBezierCurve.html 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  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
  15. href="http://en.wikipedia.org/wiki/B%C3%A9zier_curve#mediaviewer/File:B%C3%A9zier_2_big.gif"
  16. target="_blank"
  17. >quadratic bezier curve</a
  18. >, defined by a startpoint, endpoint and a single control point.
  19. </p>
  20. <h2>Code Example</h2>
  21. <code>
  22. const curve = new THREE.QuadraticBezierCurve(
  23. new THREE.Vector2( -10, 0 ),
  24. new THREE.Vector2( 20, 15 ),
  25. new THREE.Vector2( 10, 0 )
  26. );
  27. const points = curve.getPoints( 50 );
  28. const geometry = new THREE.BufferGeometry().setFromPoints( points );
  29. const material = new THREE.LineBasicMaterial( { color: 0xff0000 } );
  30. // Create the final object to add to the scene
  31. const curveObject = new THREE.Line( geometry, material );
  32. </code>
  33. <h2>Constructor</h2>
  34. <h3>
  35. [name]( [param:Vector2 v0], [param:Vector2 v1], [param:Vector2 v2] )
  36. </h3>
  37. <p>
  38. [page:Vector2 v0] – The startpoint.<br />
  39. [page:Vector2 v1] – The control point.<br />
  40. [page:Vector2 v2] – The endpoint.
  41. </p>
  42. <h2>Properties</h2>
  43. <p>See the base [page:Curve] class for common properties.</p>
  44. <h3>[property:Vector2 v0]</h3>
  45. <p>The startpoint.</p>
  46. <h3>[property:Vector2 v1]</h3>
  47. <p>The control point.</p>
  48. <h3>[property:Vector2 v2]</h3>
  49. <p>The endpoint.</p>
  50. <h2>Methods</h2>
  51. <p>See the base [page:Curve] class for common methods.</p>
  52. <h2>Source</h2>
  53. <p>
  54. [link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]
  55. </p>
  56. </body>
  57. </html>