CapsuleGeometry.html 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  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; [page:LatheGeometry] &rarr;
  11. <h1>[name]</h1>
  12. <p class="desc">
  13. [name]是一个胶囊图形类,通过半径和高度来进行构造。使用lathe来进行构造。
  14. </p>
  15. <iframe
  16. id="scene"
  17. src="scenes/geometry-browser.html#CapsuleGeometry"
  18. ></iframe>
  19. <script>
  20. // iOS iframe auto-resize workaround
  21. if ( /(iPad|iPhone|iPod)/g.test( navigator.userAgent ) ) {
  22. const scene = document.getElementById( 'scene' );
  23. scene.style.width = getComputedStyle( scene ).width;
  24. scene.style.height = getComputedStyle( scene ).height;
  25. scene.setAttribute( 'scrolling', 'no' );
  26. }
  27. </script>
  28. <h2>代码示例</h2>
  29. <code>
  30. const geometry = new THREE.CapsuleGeometry( 1, 1, 4, 8 );
  31. const material = new THREE.MeshBasicMaterial( {color: 0x00ff00} );
  32. const capsule = new THREE.Mesh( geometry, material ); scene.add( capsule );
  33. </code>
  34. <h2>构造函数</h2>
  35. <h3>
  36. [name]([param:Float radius], [param:Float height], [param:Integer capSegments], [param:Integer radialSegments], [param:Integer heightSegments])
  37. </h3>
  38. <p>
  39. radius — 胶囊半径。可选的; 默认值为1。<br />
  40. height — 中间区域的高度。可选的; 默认值为1。<br />
  41. capSegments — 构造盖子的曲线部分的个数。可选的; 默认值为4。<br />
  42. radialSegments — 覆盖胶囊圆周的分离的面的个数。可选的; 默认值为8。<br />
  43. heightSegments — 胶囊侧面沿其高度的段数,默认值为 1。<br />
  44. </p>
  45. <h2>属性</h2>
  46. <p>查看公共属性请参考基类[page:BufferGeometry]。</p>
  47. <h3>[property:Object parameters]</h3>
  48. <p>
  49. 有属性的构造函数参数对象。任何实例化之后的修改都不会改变图形。
  50. </p>
  51. <h2>方法</h2>
  52. <p>查看公共属性请参考基类[page:BufferGeometry]。</p>
  53. <h2>源码</h2>
  54. <p>
  55. [link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]
  56. </p>
  57. </body>
  58. </html>
粤ICP备19079148号