EllipseCurve.html 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  1. <!DOCTYPE html>
  2. <html lang="zh">
  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. 创建一个形状为椭圆的曲线。
  14. 将[page:Number xRadius]与[page:Number yRadius]设为相等的值它将会成为一个圆。
  15. </p>
  16. <h2>代码示例</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>构造函数</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] – 椭圆的中心的X坐标,默认值为*0*。<br/>
  35. [page:Float aY] – 椭圆的中心的Y坐标,默认值为*0*。<br/>
  36. [page:Float xRadius] – X轴向上椭圆的半径,默认值为*1*。<br/>
  37. [page:Float yRadius] – Y轴向上椭圆的半径,默认值为*1*。<br/>
  38. [page:Radians aStartAngle] – 以弧度来表示,从正X轴算起曲线开始的角度,默认值为*0*。<br/>
  39. [page:Radians aEndAngle] – 以弧度来表示,从正X轴算起曲线终止的角度,默认值为*2 x Math.PI*。<br/>
  40. [page:Boolean aClockwise] – 椭圆是否按照顺时针方向来绘制,默认值为*false*。<br/>
  41. [page:Radians aRotation] – 以弧度表示,椭圆从X轴正方向逆时针的旋转角度(可选),默认值为*0*。<br/><br/>
  42. </p>
  43. <h2>属性</h2>
  44. <p>共有属性请参见其基类[page:Curve]。</p>
  45. <h3>[property:Float aX]</h3>
  46. <p>椭圆的中心的X坐标。</p>
  47. <h3>[property:Float aY]</h3>
  48. <p>椭圆的中心的Y坐标。</p>
  49. <h3>[property:Radians xRadius]</h3>
  50. <p>X轴向上椭圆的半径。</p>
  51. <h3>[property:Radians yRadius]</h3>
  52. <p>Y轴向上椭圆的半径。</p>
  53. <h3>[property:Float aStartAngle]</h3>
  54. <p>以弧度来表示,从正右侧算起曲线开始的角度。</p>
  55. <h3>[property:Float aEndAngle]</h3>
  56. <p>以弧度来表示,从正右侧算起曲线终止的角度。</p>
  57. <h3>[property:Boolean aClockwise]</h3>
  58. <p>椭圆是否按照顺时针方向来绘制。</p>
  59. <h3>[property:Float aRotation]</h3>
  60. <p>以弧度表示,椭圆在X轴正方向逆时针的旋转角度(可选),默认值为*0*。</p>
  61. <h2>方法</h2>
  62. <p>共有方法请参见其基类[page:Curve]。</p>
  63. <h2>源代码</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>