TorusGeometry.html 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  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 torus geometries.</p>
  13. <iframe
  14. id="scene"
  15. src="scenes/geometry-browser.html#TorusGeometry"
  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.TorusGeometry( 10, 3, 16, 100 );
  29. const material = new THREE.MeshBasicMaterial( { color: 0xffff00 } );
  30. const torus = new THREE.Mesh( geometry, material );
  31. scene.add( torus );
  32. </code>
  33. <h2>Constructor</h2>
  34. <h3>
  35. [name]([param:Float radius], [param:Float tube], [param:Integer radialSegments], [param:Integer tubularSegments], [param:Float arc])
  36. </h3>
  37. <p>
  38. radius - Radius of the torus, from the center of the torus to the center
  39. of the tube. Default is `1`. <br />
  40. tube — Radius of the tube. Must be smaller than `radius`. Default is `0.4`. <br />
  41. radialSegments — Default is `12` <br />
  42. tubularSegments — Default is `48`. <br />
  43. arc — Central angle. Default is Math.PI * 2.
  44. </p>
  45. <h2>Properties</h2>
  46. <p>See the base [page:BufferGeometry] class for common properties.</p>
  47. <h3>[property:Object parameters]</h3>
  48. <p>
  49. An object with a property for each of the constructor parameters. Any
  50. modification after instantiation does not change the geometry.
  51. </p>
  52. <h2>Methods</h2>
  53. <p>See the base [page:BufferGeometry] class for common methods.</p>
  54. <h2>Source</h2>
  55. <p>
  56. [link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]
  57. </p>
  58. </body>
  59. </html>
粤ICP备19079148号