CubicBezierCurve3.html 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  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:Bezier_curve.svg" target="_blank">cubic bezier curve</a>,
  15. defined by a start point, endpoint and two control points.
  16. </p>
  17. <h2>Code Example</h2>
  18. <code>
  19. const curve = new THREE.CubicBezierCurve3(
  20. new THREE.Vector3( -10, 0, 0 ),
  21. new THREE.Vector3( -5, 15, 0 ),
  22. new THREE.Vector3( 20, 15, 0 ),
  23. new THREE.Vector3( 10, 0, 0 )
  24. );
  25. const points = curve.getPoints( 50 );
  26. const geometry = new THREE.BufferGeometry().setFromPoints( points );
  27. const material = new THREE.LineBasicMaterial( { color : 0xff0000 } );
  28. // Create the final object to add to the scene
  29. const curveObject = new THREE.Line( geometry, material );
  30. </code>
  31. <h2>Constructor</h2>
  32. <h3>[name]( [param:Vector3 v0], [param:Vector3 v1], [param:Vector3 v2], [param:Vector3 v3] )</h3>
  33. <p>
  34. [page:Vector3 v0] – The starting point.<br/>
  35. [page:Vector3 v1] – The first control point.<br/>
  36. [page:Vector3 v2] – The second control point.<br/>
  37. [page:Vector3 v3] – The ending point.
  38. </p>
  39. <h2>Properties</h2>
  40. <p>See the base [page:Curve] class for common properties.</p>
  41. <h3>[property:Vector2 v0]</h3>
  42. <p>The starting point.</p>
  43. <h3>[property:Vector2 v1]</h3>
  44. <p>The first control point.</p>
  45. <h3>[property:Vector2 v2]</h3>
  46. <p>The second control point.</p>
  47. <h3>[property:Vector2 v3]</h3>
  48. <p>The ending point.</p>
  49. <h2>Methods</h2>
  50. <p>See the base [page:Curve] class for common Methods.</p>
  51. <h2>Source</h2>
  52. <p>
  53. [link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]
  54. </p>
  55. </body>
  56. </html>