CircleGeometry.html 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  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:BufferGeometry] &rarr;
  11. <h1>[name]</h1>
  12. <p class="desc">
  13. [name] is a simple shape of Euclidean geometry. It is constructed from a
  14. number of triangular segments that are oriented around a central point and
  15. extend as far out as a given radius. It is built counter-clockwise from a
  16. start angle and a given central angle. It can also be used to create
  17. regular polygons, where the number of segments determines the number of
  18. sides.
  19. </p>
  20. <iframe
  21. id="scene"
  22. src="scenes/geometry-browser.html#CircleGeometry"
  23. ></iframe>
  24. <script>
  25. // iOS iframe auto-resize workaround
  26. if ( /(iPad|iPhone|iPod)/g.test( navigator.userAgent ) ) {
  27. const scene = document.getElementById( 'scene' );
  28. scene.style.width = getComputedStyle( scene ).width;
  29. scene.style.height = getComputedStyle( scene ).height;
  30. scene.setAttribute( 'scrolling', 'no' );
  31. }
  32. </script>
  33. <h2>Code Example</h2>
  34. <code>
  35. const geometry = new THREE.CircleGeometry( 5, 32 );
  36. const material = new THREE.MeshBasicMaterial( { color: 0xffff00 } );
  37. const circle = new THREE.Mesh( geometry, material ); scene.add( circle );
  38. </code>
  39. <h2>Constructor</h2>
  40. <h3>
  41. [name]([param:Float radius], [param:Integer segments], [param:Float thetaStart], [param:Float thetaLength])
  42. </h3>
  43. <p>
  44. radius — Radius of the circle, default = 1.<br />
  45. segments — Number of segments (triangles), minimum = `3`, default = `32`.<br />
  46. thetaStart — Start angle for first segment, default = `0` (three o'clock
  47. position).<br />
  48. thetaLength — The central angle, often called theta, of the circular
  49. sector. The default is `2`*Pi, which makes for a complete circle.
  50. </p>
  51. <h2>Properties</h2>
  52. <p>See the base [page:BufferGeometry] class for common properties.</p>
  53. <h3>[property:Object parameters]</h3>
  54. <p>
  55. An object with a property for each of the constructor parameters. Any
  56. modification after instantiation does not change the geometry.
  57. </p>
  58. <h2>Methods</h2>
  59. <p>See the base [page:BufferGeometry] class for common methods.</p>
  60. <h2>Source</h2>
  61. <p>
  62. [link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]
  63. </p>
  64. </body>
  65. </html>