Mesh.html 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113
  1. <!DOCTYPE html>
  2. <html lang="en">
  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:Object3D] &rarr;
  12. <h1>[name]</h1>
  13. <p class="desc">
  14. Class representing triangular [link:https://en.wikipedia.org/wiki/Polygon_mesh polygon mesh] based objects.
  15. Also serves as a base for other classes such as [page:SkinnedMesh].
  16. </p>
  17. <h2>Example</h2>
  18. <code>
  19. var geometry = new THREE.BoxBufferGeometry( 1, 1, 1 );
  20. var material = new THREE.MeshBasicMaterial( { color: 0xffff00 } );
  21. var mesh = new THREE.Mesh( geometry, material );
  22. scene.add( mesh );
  23. </code>
  24. <h2>Constructor</h2>
  25. <h3>[name]( [param:Geometry geometry], [param:Material material] )</h3>
  26. <p>
  27. [page:Geometry geometry] — (optional) an instance of [page:Geometry] or [page:BufferGeometry].
  28. Default is a new [page:BufferGeometry].<br />
  29. [page:Material material] — (optional) a single or an array of [page:Material]. Default is a new [page:MeshBasicMaterial]
  30. </p>
  31. <h2>Properties</h2>
  32. <p>See the base [page:Object3D] class for common properties.</p>
  33. <h3>[property:Integer drawMode]</h3>
  34. <p>
  35. Determines how the mesh triangles are constructed from the vertices.
  36. See the draw mode [page:DrawModes constants] for all possible values.
  37. Default is [page:DrawModes TrianglesDrawMode].
  38. </p>
  39. <h3>[property:Boolean isMesh]</h3>
  40. <p>
  41. Used to check whether this or derived classes are meshes. Default is *true*.<br /><br />
  42. You should not change this, as it is used internally for optimisation.
  43. </p>
  44. <h3>[property:Geometry geometry]</h3>
  45. <p>
  46. An instance of [page:Geometry] or [page:BufferGeometry] (or derived classes),
  47. defining the object's structure.<br /><br />
  48. It's recommended to always use a [page:BufferGeometry] if possible for best performance.
  49. </p>
  50. <h3>[property:Material material]</h3>
  51. <p>
  52. An instance of material derived from the [page:Material] base class or an array of materials, defining the
  53. object's appearance. Default is a [page:MeshBasicMaterial] with a random color.
  54. </p>
  55. <h3>[property:Array morphTargetInfluences]</h3>
  56. <p>
  57. An array of weights typically from 0-1 that specify how much of the morph is applied.
  58. Undefined by default, but reset to a blank array by [page:Mesh.updateMorphTargets updateMorphTargets].
  59. </p>
  60. <h3>[property:Object morphTargetDictionary]</h3>
  61. <p>
  62. A dictionary of morphTargets based on the morphTarget.name property.
  63. Undefined by default, but rebuilt [page:Mesh.updateMorphTargets updateMorphTargets].
  64. </p>
  65. <h2>Methods</h2>
  66. <p>See the base [page:Object3D] class for common methods.</p>
  67. <h3>[method:null setDrawMode]( [param:Integer value] )</h3>
  68. <p>Set the value of [page:.drawMode drawMode].</p>
  69. <h3>[method:Mesh clone]()</h3>
  70. <p>Returns a clone of this [name] object and its descendants.</p>
  71. <h3>[method:null raycast]( [param:Raycaster raycaster], [param:Array intersects] )</h3>
  72. <p>
  73. Get intersections between a casted ray and this mesh.
  74. [page:Raycaster.intersectObject] will call this method.
  75. </p>
  76. <h3>[method:null updateMorphTargets]()</h3>
  77. <p>
  78. Updates the morphTargets to have no influence on the object. Resets the
  79. [page:Mesh.morphTargetInfluences morphTargetInfluences] and
  80. [page:Mesh.morphTargetDictionary morphTargetDictionary] properties.
  81. </p>
  82. <h2>Source</h2>
  83. [link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]
  84. </body>
  85. </html>