CircleGeometry.html 2.3 KB

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