TorusGeometry.html 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  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">A class for generating torus geometries</p>
  14. <iframe id="scene" src="scenes/geometry-browser.html#TorusGeometry"></iframe>
  15. <script>
  16. // iOS iframe auto-resize workaround
  17. if ( /(iPad|iPhone|iPod)/g.test( navigator.userAgent ) ) {
  18. var scene = document.getElementById( 'scene' );
  19. scene.style.width = getComputedStyle( scene ).width;
  20. scene.style.height = getComputedStyle( scene ).height;
  21. scene.setAttribute( 'scrolling', 'no' );
  22. }
  23. </script>
  24. <h2>Example</h2>
  25. <code>var geometry = new THREE.TorusGeometry( 10, 3, 16, 100 );
  26. var material = new THREE.MeshBasicMaterial( { color: 0xffff00 } );
  27. var torus = new THREE.Mesh( geometry, material );
  28. scene.add( torus );
  29. </code>
  30. <h2>Constructor</h2>
  31. <h3>[name]([param:Float radius], [param:Float tube], [param:Integer radialSegments], [param:Integer tubularSegments], [param:Float arc])</h3>
  32. <p>
  33. radius - Radius of the torus, from the center of the torus to the center of the tube. Default is 1. <br />
  34. tube — Radius of the tube. Default is 0.4. <br />
  35. radialSegments — Default is 8 <br />
  36. tubularSegments — Default is 6. <br />
  37. arc — Central angle. Default is Math.PI * 2.
  38. </p>
  39. <h2>Properties</h2>
  40. <h3>.parameters</h3>
  41. <p>
  42. An object with a property for each of the constructor parameters. Any modification after instantiation does not change the geometry.
  43. </p>
  44. <h2>Source</h2>
  45. [link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]
  46. </body>
  47. </html>