ParametricGeometry.html 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  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">Generate geometry representing a parametric surface.</p>
  14. <iframe id="scene" src="scenes/geometry-browser.html#ParametricGeometry"></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>
  26. var geometry = new THREE.ParametricGeometry( THREE.ParametricGeometries.klein, 25, 25 );
  27. var material = new THREE.MeshBasicMaterial( { color: 0x00ff00 } );
  28. var klein = new THREE.Mesh( geometry, material );
  29. scene.add( klein );
  30. </code>
  31. <h2>Constructor</h2>
  32. <h3>[name]([param:Function func], [param:Integer slices], [param:Integer stacks])</h3>
  33. <p>
  34. 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 />
  35. slices — The count of slices to use for the parametric function <br />
  36. stacks — The count of stacks to use for the parametric function
  37. </p>
  38. <h2>Properties</h2>
  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>Source</h2>
  44. [link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]
  45. </body>
  46. </html>