QuadraticBezierCurve.html 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  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
  15. <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>,
  16. defined by a startpoint, endpoint and a single control point.
  17. </div>
  18. <h2>Example</h2>
  19. <code>
  20. var curve = new THREE.QuadraticBezierCurve(
  21. new THREE.Vector2( -10, 0 ),
  22. new THREE.Vector2( 20, 15 ),
  23. new THREE.Vector2( 10, 0 )
  24. );
  25. var geometry = new THREE.Geometry();
  26. var points = curve.getPoints( 50 );
  27. for ( var i = 0, l = points.length; i < l; i ++ ) {
  28. var point = points[ i ];
  29. geometry.vertices.push( new THREE.Vector3( point.x, point.y, 0 ) );
  30. }
  31. var material = new THREE.LineBasicMaterial( { color : 0xff0000 } );
  32. //Create the final object to add to the scene
  33. var curveObject = new THREE.Line( geometry, material );
  34. </code>
  35. <h2>Constructor</h2>
  36. <h3>[name]( [page:Vector2 v0], [page:Vector2 v1], [page:Vector2 v2] )</h3>
  37. <div>
  38. [page:Vector2 v0] – The startpoint.<br/>
  39. [page:Vector2 v1] – The control point.<br/>
  40. [page:Vector2 v2] – The endpoint.
  41. </div>
  42. <h2>Properties</h2>
  43. <div>See the base [page:Curve] class for common properties.</div>
  44. <h3>[property:Boolean isQuadraticBezierCurve]</h3>
  45. <div>
  46. Used to check whether this or derived classes are QuadraticBezierCurves. Default is *true*.<br /><br />
  47. You should not change this, as it used internally for optimisation.
  48. </div>
  49. <h3>[property:Vector2 v0]</h3>
  50. <div>The startpoint.</div>
  51. <h3>[property:Vector2 v1]</h3>
  52. <div>The control point.</div>
  53. <h3>[property:Vector2 v2]</h3>
  54. <div>The endpoint.</div>
  55. <h2>Methods</h2>
  56. <div>See the base [page:Curve] class for common methods.</div>
  57. <h2>Source</h2>
  58. [link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]
  59. </body>
  60. </html>