CircleGeometry.html 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  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:Geometry] &rarr;
  12. <h1>[name]</h1>
  13. <p 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.
  14. </p>
  15. <iframe id="scene" src="scenes/geometry-browser.html#CircleGeometry"></iframe>
  16. <script>
  17. // iOS iframe auto-resize workaround
  18. if ( /(iPad|iPhone|iPod)/g.test( navigator.userAgent ) ) {
  19. var scene = document.getElementById( 'scene' );
  20. scene.style.width = getComputedStyle( scene ).width;
  21. scene.style.height = getComputedStyle( scene ).height;
  22. scene.setAttribute( 'scrolling', 'no' );
  23. }
  24. </script>
  25. <h2>Example</h2>
  26. <code>
  27. var geometry = new THREE.CircleGeometry( 5, 32 );
  28. var material = new THREE.MeshBasicMaterial( { color: 0xffff00 } );
  29. var circle = new THREE.Mesh( geometry, material );
  30. scene.add( circle );
  31. </code>
  32. <h2>Constructor</h2>
  33. <h3>[name]([param:Float radius], [param:Integer segments], [param:Float thetaStart], [param:Float thetaLength])</h3>
  34. <p>
  35. radius — Radius of the circle, default = 1.<br />
  36. segments — Number of segments (triangles), minimum = 3, default = 8.<br />
  37. thetaStart — Start angle for first segment, default = 0 (three o'clock position).<br />
  38. thetaLength — The central angle, often called theta, of the circular sector. The default is 2*Pi, which makes for a complete circle.
  39. </p>
  40. <h2>Properties</h2>
  41. <h3>[property:Object parameters]</h3>
  42. <p>
  43. An object with a property for each of the constructor parameters. Any modification after instantiation does not change the geometry.
  44. </p>
  45. <h2>Source</h2>
  46. [link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]
  47. </body>
  48. </html>