Mesh.html 3.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  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>Code 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:Geometry geometry]</h3>
  34. <p>
  35. An instance of [page:Geometry] or [page:BufferGeometry] (or derived classes),
  36. defining the object's structure.<br /><br />
  37. It's recommended to always use a [page:BufferGeometry] if possible for best performance.
  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:null raycast]( [param:Raycaster raycaster], [param:Array intersects] )</h3>
  59. <p>
  60. Get intersections between a casted ray and this mesh.
  61. [page:Raycaster.intersectObject] will call this method, but the results are not ordered.
  62. </p>
  63. <h3>[method:null updateMorphTargets]()</h3>
  64. <p>
  65. Updates the morphTargets to have no influence on the object. Resets the
  66. [page:Mesh.morphTargetInfluences morphTargetInfluences] and
  67. [page:Mesh.morphTargetDictionary morphTargetDictionary] properties.
  68. </p>
  69. <h2>Source</h2>
  70. <p>
  71. [link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]
  72. </p>
  73. </body>
  74. </html>