Mesh.html 3.5 KB

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