QuadraticBezierCurve.html 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  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:B%C3%A9zier_2_big.gif" target="_blank">quadratic bezier curve</a>.
  15. </div>
  16. <h2>Example</h2>
  17. <code>
  18. var curve = new THREE.QuadraticBezierCurve(
  19. new THREE.Vector3( -10, 0, 0 ),
  20. new THREE.Vector3( 20, 15, 0 ),
  21. new THREE.Vector3( 10, 0, 0 )
  22. );
  23. var path = new THREE.Path( curve.getPoints( 50 ) );
  24. var geometry = path.createPointsGeometry( 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:Vector2 v0], [page:Vector2 v1], [page:Vector2 v2] )</h3>
  31. <div>
  32. [page:Vector2 v0] – The starting point<br/>
  33. [page:Vector2 v1] – The middle control point<br/>
  34. [page:Vector2 v2] – The ending point<br/>
  35. </div>
  36. <h2>Properties</h2>
  37. <h3>[property:Vector2 v0]</h3>
  38. <h3>[property:Vector2 v1]</h3>
  39. <h3>[property:Vector2 v2]</h3>
  40. <h2>Methods</h2>
  41. <h3>See [page:Curve] for inherited methods</h3>
  42. <h2>Source</h2>
  43. [link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]
  44. </body>
  45. </html>