1
0

TeapotGeometry.html 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  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] tesselates the famous Utah teapot database by Martin Newell.
  14. </p>
  15. <h2>Import</h2>
  16. <p>
  17. [name] is an add-on, and must be imported explicitly.
  18. See [link:#manual/introduction/Installation Installation / Addons].
  19. </p>
  20. <code>
  21. import { TeapotGeometry } from 'three/addons/geometries/TeapotGeometry.js';
  22. </code>
  23. <h2>Code Example</h2>
  24. <code>
  25. const geometry = new TeapotGeometry( 50, 18 );
  26. const material = new THREE.MeshBasicMaterial( { color: 0x00ff00 } );
  27. const teapot = new THREE.Mesh( geometry, material );
  28. scene.add( teapot );
  29. </code>
  30. <h2>Constructor</h2>
  31. <h3>
  32. [name]([param:Integer size], [param:Integer segments], [param:Boolean bottom], [param:Boolean lid], [param:Boolean body],
  33. [param:Boolean fitLid], [param:Boolean blinn])
  34. </h3>
  35. <p>
  36. size — Relative scale of the teapot. Optional; Defaults to `50`.<br>
  37. segments — Number of line segments to subdivide each patch edge. Optional; Defaults to `10`.<br>
  38. bottom — Whether the bottom of the teapot is generated or not. Optional; Defaults to `true`.<br>
  39. lid — Whether the lid is generated or not. Optional; Defaults to `true`.<br>
  40. body — Whether the body is generated or not. Optional; Defaults to `true`.<br>
  41. fitLid — Whether the lid is slightly stretched to prevent gaps between the body and lid or not. Optional; Defaults to `true`.<br>
  42. blinn — Whether the teapot is scaled vertically for better aesthetics or not. Optional; Defaults to `true`.
  43. </p>
  44. <h2>Properties</h2>
  45. <p>See the base [page:BufferGeometry] class for common properties.</p>
  46. <h2>Methods</h2>
  47. <p>See the base [page:BufferGeometry] class for common methods.</p>
  48. <h2>Source</h2>
  49. <p>
  50. [link:https://github.com/mrdoob/three.js/blob/master/examples/jsm/geometries/TeapotGeometry.js examples/jsm/geometries/TeapotGeometry.js]
  51. </p>
  52. </body>
  53. </html>