Mesh.html 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  1. <!DOCTYPE html>
  2. <html lang="en">
  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. Class representing triangular [link:https://en.wikipedia.org/wiki/Polygon_mesh polygon mesh] based objects.
  14. Also serves as a base for other classes such as [page:SkinnedMesh].
  15. </p>
  16. <h2>Code Example</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>Constructor</h2>
  24. <h3>[name]( [param:BufferGeometry geometry], [param:Material material] )</h3>
  25. <p>
  26. [page:BufferGeometry geometry] — (optional) an instance of [page:BufferGeometry]. Default is a new [page:BufferGeometry].<br />
  27. [page:Material material] — (optional) a single or an array of [page:Material]. Default is a new [page:MeshBasicMaterial]
  28. </p>
  29. <h2>Properties</h2>
  30. <p>See the base [page:Object3D] class for common properties.</p>
  31. <h3>[property:BufferGeometry geometry]</h3>
  32. <p>
  33. An instance of [page:BufferGeometry] (or derived classes), defining the object's structure.
  34. </p>
  35. <h3>[property:Boolean isMesh]</h3>
  36. <p>
  37. Read-only flag to check if a given object is of type [name].
  38. </p>
  39. <h3>[property:Material material]</h3>
  40. <p>
  41. An instance of material derived from the [page:Material] base class or an array of materials, defining the
  42. object's appearance. Default is a [page:MeshBasicMaterial].
  43. </p>
  44. <h3>[property:Array morphTargetInfluences]</h3>
  45. <p>
  46. An array of weights typically from 0-1 that specify how much of the morph is applied.
  47. Undefined by default, but reset to a blank array by [page:Mesh.updateMorphTargets updateMorphTargets].
  48. </p>
  49. <h3>[property:Object morphTargetDictionary]</h3>
  50. <p>
  51. A dictionary of morphTargets based on the morphTarget.name property.
  52. Undefined by default, but rebuilt [page:Mesh.updateMorphTargets updateMorphTargets].
  53. </p>
  54. <h2>Methods</h2>
  55. <p>See the base [page:Object3D] class for common methods.</p>
  56. <h3>[method:Mesh clone]()</h3>
  57. <p>Returns a clone of this [name] object and its descendants.</p>
  58. <h3>[method:Vector3 getVertexPosition]( [param:Integer index], [param:Vector3 target] )</h3>
  59. <p>
  60. Get the local-space position of the vertex at the given index, taking into account the
  61. current animation state of both morph targets and skinning.
  62. </p>
  63. <h3>[method:undefined raycast]( [param:Raycaster raycaster], [param:Array intersects] )</h3>
  64. <p>
  65. Get intersections between a casted ray and this mesh.
  66. [page:Raycaster.intersectObject] will call this method, but the results are not ordered.
  67. </p>
  68. <h3>[method:undefined updateMorphTargets]()</h3>
  69. <p>
  70. Updates the morphTargets to have no influence on the object. Resets the
  71. [page:Mesh.morphTargetInfluences morphTargetInfluences] and
  72. [page:Mesh.morphTargetDictionary morphTargetDictionary] properties.
  73. </p>
  74. <h2>Source</h2>
  75. <p>
  76. [link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]
  77. </p>
  78. </body>
  79. </html>