CylinderGeometry.html 2.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  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">A class for generating cylinder geometries.</p>
  13. <iframe
  14. id="scene"
  15. src="scenes/geometry-browser.html#CylinderGeometry"
  16. ></iframe>
  17. <script>
  18. // iOS iframe auto-resize workaround
  19. if ( /(iPad|iPhone|iPod)/g.test( navigator.userAgent ) ) {
  20. const scene = document.getElementById( 'scene' );
  21. scene.style.width = getComputedStyle( scene ).width;
  22. scene.style.height = getComputedStyle( scene ).height;
  23. scene.setAttribute( 'scrolling', 'no' );
  24. }
  25. </script>
  26. <h2>Code Example</h2>
  27. <code>
  28. const geometry = new THREE.CylinderGeometry( 5, 5, 20, 32 );
  29. const material = new THREE.MeshBasicMaterial( {color: 0xffff00} );
  30. const cylinder = new THREE.Mesh( geometry, material ); scene.add( cylinder );
  31. </code>
  32. <h2>Constructor</h2>
  33. <h3>
  34. [name]([param:Float radiusTop], [param:Float radiusBottom], [param:Float height], [param:Integer radialSegments], [param:Integer heightSegments],
  35. [param:Boolean openEnded], [param:Float thetaStart], [param:Float thetaLength])
  36. </h3>
  37. <p>
  38. radiusTop — Radius of the cylinder at the top. Default is `1`.<br />
  39. radiusBottom — Radius of the cylinder at the bottom. Default is `1`.<br />
  40. height — Height of the cylinder. Default is `1`.<br />
  41. radialSegments — Number of segmented faces around the circumference of the
  42. cylinder. Default is `32`<br />
  43. heightSegments — Number of rows of faces along the height of the cylinder.
  44. Default is `1`.<br />
  45. openEnded — A Boolean indicating whether the ends of the cylinder are open
  46. or capped. Default is false, meaning capped.<br />
  47. thetaStart — Start angle for first segment, default = 0 (three o'clock
  48. position).<br />
  49. thetaLength — The central angle, often called theta, of the circular
  50. sector. The default is `2`*Pi, which makes for a complete cylinder.
  51. </p>
  52. <h2>Properties</h2>
  53. <p>See the base [page:BufferGeometry] class for common properties.</p>
  54. <h3>[property:Object parameters]</h3>
  55. <p>
  56. An object with a property for each of the constructor parameters. Any
  57. modification after instantiation does not change the geometry.
  58. </p>
  59. <h2>Methods</h2>
  60. <p>See the base [page:BufferGeometry] class for common methods.</p>
  61. <h2>Source</h2>
  62. <p>
  63. [link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]
  64. </p>
  65. </body>
  66. </html>