CubicBezierCurve.html 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  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. <p 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. </p>
  18. <h2>Example</h2>
  19. <code>
  20. var curve = new THREE.CubicBezierCurve(
  21. new THREE.Vector2( -10, 0 ),
  22. new THREE.Vector2( -5, 15 ),
  23. new THREE.Vector2( 20, 15 ),
  24. new THREE.Vector2( 10, 0 )
  25. );
  26. var points = curve.getPoints( 50 );
  27. var geometry = new THREE.BufferGeometry().setFromPoints( points );
  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] ( [param:Vector2 v0], [param:Vector2 v1], [param:Vector2 v2], [param:Vector2 v3] )</h3>
  34. <p>
  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. </p>
  40. <h2>Properties</h2>
  41. <p>See the base [page:Curve] class for common properties.</p>
  42. <h3>[property:Boolean isCubicBezierCurve]</h3>
  43. <p>
  44. Used to check whether this or derived classes are CubicBezierCurves. Default is *true*.<br /><br />
  45. You should not change this, as it used internally for optimisation.
  46. </p>
  47. <h3>[property:Vector2 v0]</h3>
  48. <p>The starting point.</p>
  49. <h3>[property:Vector2 v1]</h3>
  50. <p>The first control point.</p>
  51. <h3>[property:Vector2 v2]</h3>
  52. <p>The second control point.</p>
  53. <h3>[property:Vector2 v3]</h3>
  54. <p>The ending point.</p>
  55. <h2>Methods</h2>
  56. <p>See the base [page:Curve] class for common Methods.</p>
  57. <h2>Source</h2>
  58. [link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]
  59. </body>
  60. </html>