Class representing triangular polygon mesh based objects. Also serves as a base for other classes such as SkinnedMesh.
const geometry = new v3d.BoxGeometry(1, 1, 1);
const material = new v3d.MeshBasicMaterial({ color: 0xffff00 });
const mesh = new v3d.Mesh(geometry, material);
app.scene.add(mesh);
geometry — (optional) an instance of BufferGeometry. Default is a new BufferGeometry.
material — (optional) a single or an array of Material. Default is a new MeshBasicMaterial
See the base Object3D class for common properties.
An instance of BufferGeometry (or derived classes), defining the object's structure.
Read-only flag to check if a given object is of type Mesh.
An instance of material derived from the Material base class or an array of materials, defining the object's appearance. Default is a MeshBasicMaterial.
An array of weights typically from 0-1 that specify how much of the morph is applied. Undefined by default, but reset to a blank array by updateMorphTargets.
A dictionary of morphTargets based on the morphTarget.name property. Undefined by default, but rebuilt updateMorphTargets.
See the base Object3D class for common methods.
Returns a clone of this Mesh object and its descendants.
Get the current position of the indicated vertex in local space, taking into account the current animation state of both morph targets and skinning.
Get intersections between a casted ray and this mesh. Raycaster.intersectObject will call this method, but the results are not ordered.
Updates the morphTargets to have no influence on the object. Resets the morphTargetInfluences and morphTargetDictionary properties.
For more info on how to obtain the source code of this module see this page.