ParametricGeometry.html 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  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">Generate geometry representing a parametric surface.</p>
  13. <iframe id="scene" src="scenes/geometry-browser.html#ParametricGeometry"></iframe>
  14. <script>
  15. // iOS iframe auto-resize workaround
  16. if ( /(iPad|iPhone|iPod)/g.test( navigator.userAgent ) ) {
  17. const scene = document.getElementById( 'scene' );
  18. scene.style.width = getComputedStyle( scene ).width;
  19. scene.style.height = getComputedStyle( scene ).height;
  20. scene.setAttribute( 'scrolling', 'no' );
  21. }
  22. </script>
  23. <h2>Code Example</h2>
  24. <code>
  25. const geometry = new THREE.ParametricGeometry( THREE.ParametricGeometries.klein, 25, 25 );
  26. const material = new THREE.MeshBasicMaterial( { color: 0x00ff00 } );
  27. const klein = new THREE.Mesh( geometry, material );
  28. scene.add( klein );
  29. </code>
  30. <h2>Constructor</h2>
  31. <h3>[name]([param:Function func], [param:Integer slices], [param:Integer stacks])</h3>
  32. <p>
  33. func — A function that takes in a [page:Float u] and [page:Float v] value each between 0 and 1 and modifies a third [page:Vector3] argument<br />
  34. slices — The count of slices to use for the parametric function <br />
  35. stacks — The count of stacks to use for the parametric function
  36. </p>
  37. <h2>Properties</h2>
  38. <p>See the base [page:BufferGeometry] class for common properties.</p>
  39. <h3>[property:Object parameters]</h3>
  40. <p>
  41. An object with a property for each of the constructor parameters. Any modification after instantiation does not change the geometry.
  42. </p>
  43. <h2>Methods</h2>
  44. <p>See the base [page:BufferGeometry] class for common methods.</p>
  45. <h2>Source</h2>
  46. <p>
  47. [link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]
  48. </p>
  49. </body>
  50. </html>