Mesh.html 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119
  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. <p>
  40. A sensible usage of this property is only possible when [page:Mesh.geometry] is of type [page:BufferGeometry BufferGeometry]
  41. since the engine always assumes *THREE.TrianglesDrawMode* for [page:Geometry Geometry].
  42. </p>
  43. <h3>[property:Boolean isMesh]</h3>
  44. <p>
  45. Used to check whether this or derived classes are meshes. Default is *true*.<br /><br />
  46. You should not change this, as it is used internally for optimisation.
  47. </p>
  48. <h3>[property:Geometry geometry]</h3>
  49. <p>
  50. An instance of [page:Geometry] or [page:BufferGeometry] (or derived classes),
  51. defining the object's structure.<br /><br />
  52. It's recommended to always use a [page:BufferGeometry] if possible for best performance.
  53. </p>
  54. <h3>[property:Material material]</h3>
  55. <p>
  56. An instance of material derived from the [page:Material] base class or an array of materials, defining the
  57. object's appearance. Default is a [page:MeshBasicMaterial] with a random color.
  58. </p>
  59. <h3>[property:Array morphTargetInfluences]</h3>
  60. <p>
  61. An array of weights typically from 0-1 that specify how much of the morph is applied.
  62. Undefined by default, but reset to a blank array by [page:Mesh.updateMorphTargets updateMorphTargets].
  63. </p>
  64. <h3>[property:Object morphTargetDictionary]</h3>
  65. <p>
  66. A dictionary of morphTargets based on the morphTarget.name property.
  67. Undefined by default, but rebuilt [page:Mesh.updateMorphTargets updateMorphTargets].
  68. </p>
  69. <h2>Methods</h2>
  70. <p>See the base [page:Object3D] class for common methods.</p>
  71. <h3>[method:null setDrawMode]( [param:Integer value] )</h3>
  72. <p>Set the value of [page:.drawMode drawMode].</p>
  73. <h3>[method:Mesh clone]()</h3>
  74. <p>Returns a clone of this [name] object and its descendants.</p>
  75. <h3>[method:null raycast]( [param:Raycaster raycaster], [param:Array intersects] )</h3>
  76. <p>
  77. Get intersections between a casted ray and this mesh.
  78. [page:Raycaster.intersectObject] will call this method, but the results are not ordered.
  79. </p>
  80. <h3>[method:null updateMorphTargets]()</h3>
  81. <p>
  82. Updates the morphTargets to have no influence on the object. Resets the
  83. [page:Mesh.morphTargetInfluences morphTargetInfluences] and
  84. [page:Mesh.morphTargetDictionary morphTargetDictionary] properties.
  85. </p>
  86. <h2>Source</h2>
  87. <p>
  88. [link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]
  89. </p>
  90. </body>
  91. </html>