Mesh.html 2.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  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:Geometry geometry], [param:Material material] )</h3>
  25. <p>
  26. [page:Geometry geometry] — (optional) an instance of [page:Geometry] or [page:BufferGeometry].
  27. Default is a new [page:BufferGeometry].<br />
  28. [page:Material material] — (optional) a single or an array of [page:Material]. Default is a new [page:MeshBasicMaterial]
  29. </p>
  30. <h2>Properties</h2>
  31. <p>See the base [page:Object3D] class for common properties.</p>
  32. <h3>[property:Geometry geometry]</h3>
  33. <p>
  34. An instance of [page:Geometry] or [page:BufferGeometry] (or derived classes),
  35. defining the object's structure.<br /><br />
  36. It's recommended to always use a [page:BufferGeometry] if possible for best performance.
  37. </p>
  38. <h3>[property:Material material]</h3>
  39. <p>
  40. An instance of material derived from the [page:Material] base class or an array of materials, defining the
  41. object's appearance. Default is a [page:MeshBasicMaterial].
  42. </p>
  43. <h3>[property:Array morphTargetInfluences]</h3>
  44. <p>
  45. An array of weights typically from 0-1 that specify how much of the morph is applied.
  46. Undefined by default, but reset to a blank array by [page:Mesh.updateMorphTargets updateMorphTargets].
  47. </p>
  48. <h3>[property:Object morphTargetDictionary]</h3>
  49. <p>
  50. A dictionary of morphTargets based on the morphTarget.name property.
  51. Undefined by default, but rebuilt [page:Mesh.updateMorphTargets updateMorphTargets].
  52. </p>
  53. <h2>Methods</h2>
  54. <p>See the base [page:Object3D] class for common methods.</p>
  55. <h3>[method:Mesh clone]()</h3>
  56. <p>Returns a clone of this [name] object and its descendants.</p>
  57. <h3>[method:null raycast]( [param:Raycaster raycaster], [param:Array intersects] )</h3>
  58. <p>
  59. Get intersections between a casted ray and this mesh.
  60. [page:Raycaster.intersectObject] will call this method, but the results are not ordered.
  61. </p>
  62. <h3>[method:null updateMorphTargets]()</h3>
  63. <p>
  64. Updates the morphTargets to have no influence on the object. Resets the
  65. [page:Mesh.morphTargetInfluences morphTargetInfluences] and
  66. [page:Mesh.morphTargetDictionary morphTargetDictionary] properties.
  67. </p>
  68. <h2>Source</h2>
  69. <p>
  70. [link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]
  71. </p>
  72. </body>
  73. </html>