EllipseCurve.html 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="utf-8" />
  5. <base href="../../../../" />
  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. <p class="desc">
  13. Creates a 2d curve in the shape of an ellipse. Setting the [page:Number xRadius] equal to the [page:Number yRadius] will result in a circle.
  14. </p>
  15. <h2>Code Example</h2>
  16. <code>
  17. const curve = new THREE.EllipseCurve(
  18. 0, 0, // ax, aY
  19. 10, 10, // xRadius, yRadius
  20. 0, 2 * Math.PI, // aStartAngle, aEndAngle
  21. false, // aClockwise
  22. 0 // aRotation
  23. );
  24. const points = curve.getPoints( 50 );
  25. const geometry = new THREE.BufferGeometry().setFromPoints( points );
  26. const material = new THREE.LineBasicMaterial( { color: 0xff0000 } );
  27. // Create the final object to add to the scene
  28. const ellipse = new THREE.Line( geometry, material );
  29. </code>
  30. <h2>Constructor</h2>
  31. <h3>
  32. [name]( [param:Float aX], [param:Float aY], [param:Float xRadius],
  33. [param:Float yRadius], [param:Radians aStartAngle], [param:Radians aEndAngle], [param:Boolean aClockwise], [param:Radians aRotation] )
  34. </h3>
  35. <p>
  36. [page:Float aX] – The X center of the ellipse. Default is `0`.<br />
  37. [page:Float aY] – The Y center of the ellipse. Default is `0`.<br />
  38. [page:Float xRadius] – The radius of the ellipse in the x direction.
  39. Default is `1`.<br />
  40. [page:Float yRadius] – The radius of the ellipse in the y direction.
  41. Default is `1`.<br />
  42. [page:Radians aStartAngle] – The start angle of the curve in radians
  43. starting from the positive X axis. Default is `0`.<br />
  44. [page:Radians aEndAngle] – The end angle of the curve in radians starting
  45. from the positive X axis. Default is `2 x Math.PI`.<br />
  46. [page:Boolean aClockwise] – Whether the ellipse is drawn clockwise.
  47. Default is `false`.<br />
  48. [page:Radians aRotation] – The rotation angle of the ellipse in radians,
  49. counterclockwise from the positive X axis (optional). Default is `0`.<br /><br />
  50. </p>
  51. <h2>Properties</h2>
  52. <p>See the base [page:Curve] class for common properties.</p>
  53. <h3>[property:Float aX]</h3>
  54. <p>The X center of the ellipse.</p>
  55. <h3>[property:Float aY]</h3>
  56. <p>The Y center of the ellipse.</p>
  57. <h3>[property:Radians xRadius]</h3>
  58. <p>The radius of the ellipse in the x direction.</p>
  59. <h3>[property:Radians yRadius]</h3>
  60. <p>The radius of the ellipse in the y direction.</p>
  61. <h3>[property:Float aStartAngle]</h3>
  62. <p>
  63. The start angle of the curve in radians starting from the middle right
  64. side.
  65. </p>
  66. <h3>[property:Float aEndAngle]</h3>
  67. <p>
  68. The end angle of the curve in radians starting from the middle right side.
  69. </p>
  70. <h3>[property:Boolean aClockwise]</h3>
  71. <p>Whether the ellipse is drawn clockwise.</p>
  72. <h3>[property:Float aRotation]</h3>
  73. <p>
  74. The rotation angle of the ellipse in radians, counterclockwise from the
  75. positive X axis (optional). Default is `0`.
  76. </p>
  77. <h2>Methods</h2>
  78. <p>See the base [page:Curve] class for common methods.</p>
  79. <h2>Source</h2>
  80. <p>
  81. [link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]
  82. </p>
  83. </body>
  84. </html>