QuadraticBezierCurve3.html 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  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 3d
  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.QuadraticBezierCurve3(
  20. new THREE.Vector3( -10, 0, 0 ),
  21. new THREE.Vector3( 20, 15, 0 ),
  22. new THREE.Vector3( 10, 0, 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:Vector3 v0], [param:Vector3 v1], [param:Vector3 v2] )</h3>
  32. <p>
  33. [page:Vector3 v0] – The starting point<br/>
  34. [page:Vector3 v1] – The middle control point<br/>
  35. [page:Vector3 v2] – The ending point<br/>
  36. </p>
  37. <h2>Properties</h2>
  38. <p>See the base [page:Curve] class for common properties.</p>
  39. <h3>[property:Vector3 v0]</h3>
  40. <p>The startpoint.</p>
  41. <h3>[property:Vector3 v1]</h3>
  42. <p>The control point.</p>
  43. <h3>[property:Vector3 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>