CircleGeometry.html 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="utf-8" />
  5. <script src="../../../list.js"></script>
  6. <script src="../../../page.js"></script>
  7. <link type="text/css" rel="stylesheet" href="../../../page.css" />
  8. </head>
  9. <body>
  10. [page:Geometry] &rarr;
  11. <h1>[name]</h1>
  12. <div class="desc">CircleGeometry is a simple shape of Euclidean geometry. It is contructed from a number of triangular segments that are oriented around a central point and extend as far out as a given radius. It is built counter-clockwise from a start angle and a given central angle. It can also be used to create regular polygons, where the number of segments determines the number of sides.
  13. </div>
  14. <h2>Example</h2>
  15. <iframe src='../../../scenes/geometry-browser.html#CircleGeometry'></iframe>
  16. <code>var material = new THREE.MeshBasicMaterial({
  17. color: 0x0000ff
  18. });
  19. var radius = 5;
  20. var segments = 32;
  21. var circleGeometry = new THREE.CircleGeometry( radius, segments );
  22. var circle = new THREE.Mesh( circleGeometry, material );
  23. scene.add( circle );
  24. </code>
  25. <h2>Constructor</h2>
  26. <h3>[name]([page:Float radius], [page:Integer segments], [page:Float thetaStart], [page:Float thetaLength])</h3>
  27. <div>
  28. radius — Radius of the circle, default = 50.<br />
  29. segments — Number of segments (triangles), minimum = 3, default = 8.<br />
  30. thetaStart — Start angle for first segment, default = 0 (three o'clock position).<br />
  31. thetaLength — The central angle, often called theta, of the circular sector. The default is 2*Pi, which makes for a complete circle.
  32. </div>
  33. <h2>Source</h2>
  34. [link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]
  35. </body>
  36. </html>