PlaneGeometry.html 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  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. <iframe
  14. id="scene"
  15. src="scenes/geometry-browser.html#PlaneGeometry"
  16. ></iframe>
  17. <script>
  18. // iOS iframe auto-resize workaround
  19. if ( /(iPad|iPhone|iPod)/g.test( navigator.userAgent ) ) {
  20. const scene = document.getElementById( 'scene' );
  21. scene.style.width = getComputedStyle( scene ).width;
  22. scene.style.height = getComputedStyle( scene ).height;
  23. scene.setAttribute( 'scrolling', 'no' );
  24. }
  25. </script>
  26. <h2>代码示例</h2>
  27. <code>
  28. const geometry = new THREE.PlaneGeometry( 1, 1 );
  29. const material = new THREE.MeshBasicMaterial( {color: 0xffff00, side: THREE.DoubleSide} );
  30. const plane = new THREE.Mesh( geometry, material );
  31. scene.add( plane );
  32. </code>
  33. <h2>构造函数(Constructor)</h2>
  34. <h3>
  35. [name]([param:Float width], [param:Float height], [param:Integer widthSegments], [param:Integer heightSegments])
  36. </h3>
  37. <p>
  38. width — 平面沿着 X 轴的宽度。默认值是 `1`。<br />
  39. height — 平面沿着 Y 轴的高度。默认值是 `1`。<br />
  40. widthSegments — (可选)平面的宽度分段数,默认值是 `1`。<br />
  41. heightSegments — (可选)平面的高度分段数,默认值是 `1`。
  42. </p>
  43. <h2>属性(Properties)</h2>
  44. <p>共有属性请参见其基类 [page:BufferGeometry]。</p>
  45. <h3>[property:Object parameters]</h3>
  46. <p>
  47. 一个包含着构造函数中每个参数的对象。在对象实例化之后,对该属性的任何修改都不会改变这个几何体。
  48. </p>
  49. <h2>方法(Methods)</h2>
  50. <p>共有方法请参见其基类[page:BufferGeometry]。</p>
  51. <h2>源码(Source)</h2>
  52. <p>
  53. [link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]
  54. </p>
  55. </body>
  56. </html>