QuadraticBezierCurve.html 1.5 KB

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