CubicBezierCurve.html 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  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 <a href="http://en.wikipedia.org/wiki/B%C3%A9zier_curve#mediaviewer/File:Bezier_curve.svg" target="_blank">cubic bezier curve</a>.
  15. </div>
  16. <h2>Example</h2>
  17. <code>
  18. var curve = new THREE.CubicBezierCurve(
  19. new THREE.Vector3( -10, 0, 0 ),
  20. new THREE.Vector3( -5, 15, 0 ),
  21. new THREE.Vector3( 20, 15, 0 ),
  22. new THREE.Vector3( 10, 0, 0 )
  23. );
  24. var path = new THREE.Path( curve.getPoints( 50 ) );
  25. var geometry = path.createPointsGeometry( 50 );
  26. var material = new THREE.LineBasicMaterial( { color : 0xff0000 } );
  27. // Create the final Object3d to add to the scene
  28. var curveObject = new THREE.Line( geometry, material );
  29. </code>
  30. <h2>Constructor</h2>
  31. <h3>[name] ( [page:Vector2 v0], [page:Vector2 v1], [page:Vector2 v2], [page:Vector2 v3] )</h3>
  32. <div>
  33. [page:Vector2 v0] – The starting point<br/>
  34. [page:Vector2 v1] – The first control point<br/>
  35. [page:Vector2 v2] – The second control point<br/>
  36. [page:Vector2 v3] – The ending point<br/>
  37. </div>
  38. <h2>Properties</h2>
  39. <h3>[property:Vector2 v0]</h3>
  40. <h3>[property:Vector2 v1]</h3>
  41. <h3>[property:Vector2 v2]</h3>
  42. <h3>[property:Vector2 v3]</h3>
  43. <h2>Methods</h2>
  44. <h3>See [page:Curve] for inherited methods</h3>
  45. <h2>Source</h2>
  46. [link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]
  47. </body>
  48. </html>