Mesh.html 2.8 KB

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