LatheBufferGeometry.html 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. <!DOCTYPE html>
  2. <html lang="zh">
  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:BufferGeometry] &rarr;
  12. <h1>车削缓冲几何体([name])</h1>
  13. <p class="desc">这是[page:LatheGeometry]中的[page:BufferGeometry]接口。</p>
  14. <iframe id="scene" src="scenes/geometry-browser.html#LatheBufferGeometry"></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>代码示例</h2>
  25. <code>
  26. var points = [];
  27. for ( var i = 0; i < 10; i ++ ) {
  28. points.push( new THREE.Vector2( Math.sin( i * 0.2 ) * 10 + 5, ( i - 5 ) * 2 ) );
  29. }
  30. var geometry = new THREE.LatheBufferGeometry( points );
  31. var material = new THREE.MeshBasicMaterial( { color: 0xffff00 } );
  32. var lathe = new THREE.Mesh( geometry, material );
  33. scene.add( lathe );
  34. </code>
  35. <h2>构造器</h2>
  36. <h3>[name]([param:Array points], [param:Integer segments], [param:Float phiStart], [param:Float phiLength])</h3>
  37. <p>
  38. points — 一个Vector2对象数组。每个点的X坐标必须大于0。<br />
  39. segments — 要生成的车削几何体圆周分段的数量,默认值是12。<br />
  40. phiStart — 以弧度表示的起始角度,默认值为0。<br />
  41. phiLength — 车削部分的弧度(0-2PI)范围,2PI将是一个完全闭合的、完整的车削几何体,小于2PI是部分的车削。默认值是2PI。
  42. </p>
  43. <p>
  44. 基于参数创建一个LatheGeometry。
  45. </p>
  46. <h2>属性</h2>
  47. <p>共有属性请参见其基类[page:BufferGeometry]。</p>
  48. <h3>[property:Object parameters]</h3>
  49. <p>
  50. 一个包含着构造函数中每个参数的对象。在对象实例化之后,对该属性的任何修改都不会改变这个几何体。
  51. </p>
  52. <h2>方法(Methods)</h2>
  53. <p>共有方法请参见其基类[page:BufferGeometry]。</p>
  54. <h2>源代码</h2>
  55. <p>
  56. [link:https://github.com/mrdoob/three.js/blob/master/src/geometries/LatheGeometry.js src/geometries/LatheGeometry.js]
  57. </p>
  58. </body>
  59. </html>