CubicBezierCurve3.html 1.6 KB

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