EllipseCurve.html 3.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  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. Creates a 2d curve in the shape of an ellipse. Setting the
  15. [page:Number xRadius] equal to the [page:Number yRadius] will result in a circle.
  16. </div>
  17. <h2>Example</h2>
  18. <code>
  19. var curve = new THREE.EllipseCurve(
  20. 0, 0, // ax, aY
  21. 10, 10, // xRadius, yRadius
  22. 0, 2 * Math.PI, // aStartAngle, aEndAngle
  23. false, // aClockwise
  24. 0 // aRotation
  25. );
  26. var path = new THREE.Path( curve.getPoints( 50 ) );
  27. var geometry = path.createPointsGeometry( 50 );
  28. var material = new THREE.LineBasicMaterial( { color : 0xff0000 } );
  29. // Create the final object to add to the scene
  30. var ellipse = new THREE.Line( geometry, material );
  31. </code>
  32. <h2>Constructor</h2>
  33. <h3>[name]( [page:Float aX], [page:Float aY], [page:Float xRadius], [page:Float yRadius], [page:Radians aStartAngle], [page:Radians aEndAngle], [page:Boolean aClockwise], [page:Radians aRotation] )</h3>
  34. <div>
  35. [page:Float aX] – The X center of the ellipse.<br/>
  36. [page:Float aY] – The Y center of the ellipse.<br/>
  37. [page:Float xRadius] – The radius of the ellipse in the x direction.<br/>
  38. [page:Float yRadius] – The radius of the ellipse in the y direction.<br/>
  39. [page:Radians aStartAngle] – The start angle of the curve in radians starting from the middle right side.<br/>
  40. [page:Radians aEndAngle] – The end angle of the curve in radians starting from the middle right side.<br/>
  41. [page:Boolean aClockwise] – Whether the ellipse is drawn clockwise.<br/>
  42. [page:Radians aRotation] – The rotation angle of the ellipse in radians, counterclockwise from the positive X axis (optional). Default is *0*.<br/><br/>
  43. <em>Note:</em> When going clockwise it's best to set the start angle to (Math.PI * 2) and then work towards lower numbers.
  44. </div>
  45. <h2>Properties</h2>
  46. <div>See the base [page:Curve] class for common properties.</div>
  47. <h3>[property:Float aX]</h3>
  48. <div>The X center of the ellipse.</div>
  49. <h3>[property:Float aY]</h3>
  50. <div>The Y center of the ellipse.</div>
  51. <h3>[property:Radians xRadius]</h3>
  52. <div>The radius of the ellipse in the x direction.</div>
  53. <h3>[property:Radians yRadius]</h3>
  54. <div>The radius of the ellipse in the y direction.</div>
  55. <h3>[property:Float aStartAngle]</h3>
  56. <div>The start angle of the curve in radians starting from the middle right side.</div>
  57. <h3>[property:Float aEndAngle]</h3>
  58. <div>The end angle of the curve in radians starting from the middle right side.</div>
  59. <h3>[property:Boolean aClockwise]</h3>
  60. <div>Whether the ellipse is drawn clockwise.</div>
  61. <h3>[property:Float aRotation]</h3>
  62. <div>The rotation angle of the ellipse in radians, counterclockwise from the positive X axis (optional). Default is *0*.</div>
  63. <h3>[property:Boolean isEllipseCurve]</h3>
  64. <div>
  65. Used to check whether this or derived classes are ellipses. Default is *true*.<br /><br />
  66. You should not change this, as it used internally for optimisation.
  67. </div>
  68. <h2>Methods</h2>
  69. <div>See the base [page:Curve] class for common methods.</div>
  70. <h2>Source</h2>
  71. [link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]
  72. </body>
  73. </html>