EllipseCurve.html 3.2 KB

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