ParametricGeometry.html 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. <!DOCTYPE html>
  2. <html lang="zh">
  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">生成由参数表示其表面的几何体。</p>
  13. <script>
  14. // iOS iframe auto-resize workaround
  15. if ( /(iPad|iPhone|iPod)/g.test( navigator.userAgent ) ) {
  16. const scene = document.getElementById( 'scene' );
  17. scene.style.width = getComputedStyle( scene ).width;
  18. scene.style.height = getComputedStyle( scene ).height;
  19. scene.setAttribute( 'scrolling', 'no' );
  20. }
  21. </script>
  22. <h2>代码示例</h2>
  23. <code>
  24. const geometry = new THREE.ParametricGeometry( THREE.ParametricGeometries.klein, 25, 25 );
  25. const material = new THREE.MeshBasicMaterial( { color: 0x00ff00 } );
  26. const klein = new THREE.Mesh( geometry, material );
  27. scene.add( klein );
  28. </code>
  29. <h2>构造函数</h2>
  30. <h3>[name]([param:Function func], [param:Integer slices], [param:Integer stacks])</h3>
  31. <p>
  32. 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. Default is a function that generates a curved plane surface.<br />
  33. slices — The count of slices to use for the parametric function. Default is *8*.<br />
  34. stacks — The count of stacks to use for the parametric function. Default is *8*.
  35. </p>
  36. <h2>属性</h2>
  37. <p>共有属性请参见其基类[page:BufferGeometry]。</p>
  38. <h3>[property:Object parameters]</h3>
  39. <p>
  40. 一个包含着构造函数中每个参数的对象。在对象实例化之后,对该属性的任何修改都不会改变这个几何体。
  41. </p>
  42. <h2>方法(Methods)</h2>
  43. <p>共有方法请参见其基类[page:BufferGeometry]。</p>
  44. <h2>方法</h2>
  45. <p>
  46. [link:https://github.com/mrdoob/three.js/blob/master/examples/jsm/geometries/ParametricGeometry.js examples/jsm/geometries/ParametricGeometry.js]
  47. </p>
  48. </body>
  49. </html>