CubicBezierCurve.html 1.9 KB

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