Mesh.html 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  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:Object3D] &rarr;
  11. <h1>网格([name])</h1>
  12. <p class="desc">
  13. 表示基于以三角形为[link:https://en.wikipedia.org/wiki/Polygon_mesh polygon mesh](多边形网格)的物体的类。
  14. 同时也作为其他类的基类,例如[page:SkinnedMesh]。
  15. </p>
  16. <h2>代码示例</h2>
  17. <code>
  18. const geometry = new THREE.BoxGeometry( 1, 1, 1 );
  19. const material = new THREE.MeshBasicMaterial( { color: 0xffff00 } );
  20. const mesh = new THREE.Mesh( geometry, material );
  21. scene.add( mesh );
  22. </code>
  23. <h2>构造器</h2>
  24. <h3>[name]( [param:BufferGeometry geometry], [param:Material material] )</h3>
  25. <p>
  26. [page:BufferGeometry geometry] —— (可选)[page:BufferGeometry]的实例,默认值是一个新的[page:BufferGeometry]。<br />
  27. [page:Material material] —— (可选)一个[page:Material],或是一个包含有[page:Material]的数组,默认是一个新的[page:MeshBasicMaterial]。
  28. </p>
  29. <h2>属性</h2>
  30. <p>共有属性请参见其基类[page:Object3D]。</p>
  31. <h3>[property:BufferGeometry geometry]</h3>
  32. <p>
  33. [page:BufferGeometry] 的实例或者派生类,定义了物体的结构。
  34. </p>
  35. <h3>[property:Material material]</h3>
  36. <p>
  37. 由[page:Material]基类或者一个包含材质的数组派生而来的材质实例,定义了物体的外观。默认值是一个[page:MeshBasicMaterial]。
  38. </p>
  39. <h3>[property:Array morphTargetInfluences]</h3>
  40. <p>
  41. 一个包含有权重(值一般在0-1范围内)的数组,指定应用了多少变形。
  42. 默认情况下是未定义的,但是会被[page:Mesh.updateMorphTargets updateMorphTargets]重置为一个空数组。
  43. </p>
  44. <h3>[property:Object morphTargetDictionary]</h3>
  45. <p>
  46. 基于morphTarget.name属性的morphTargets字典。
  47. 默认情况下是未定义的,但是会被[page:Mesh.updateMorphTargets updateMorphTargets]重建。
  48. </p>
  49. <h2>方法</h2>
  50. <p>共有方法请参见其基类[page:Object3D]。</p>
  51. <h3>[method:Mesh clone]()</h3>
  52. <p>返回这个[name]对象及其子级的克隆。</p>
  53. <h3>[method:null raycast]( [param:Raycaster raycaster], [param:Array intersects] )</h3>
  54. <p>
  55. 在一条投射出去的[page:Ray](射线)和这个网格之间产生交互。
  56. [page:Raycaster.intersectObject]将会调用这个方法。
  57. </p>
  58. <h3>[method:null updateMorphTargets]()</h3>
  59. <p>
  60. 更新morphTargets,使其不对对象产生影响,重置[page:Mesh.morphTargetInfluences morphTargetInfluences] and
  61. [page:Mesh.morphTargetDictionary morphTargetDictionary]属性。
  62. </p>
  63. <h2>源代码</h2>
  64. <p>
  65. [link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]
  66. </p>
  67. </body>
  68. </html>