File: Mesh.md | Updated: 11/15/2025
Class representing triangular polygon mesh based objects.
const geometry = new THREE.BoxGeometry( 1, 1, 1 );
const material = new THREE.MeshBasicMaterial( { color: 0xffff00 } );
const mesh = new THREE.Mesh( geometry, material );
scene.add( mesh );
Constructs a new mesh.
geometry | The mesh geometry.
---|---
material | The mesh material.
The number of instances of this mesh. Can only be used with WebGPURenderer.
Default is 1.
The mesh geometry.
This flag can be used for type testing.
Default is true.
The mesh material.
Default is MeshBasicMaterial.
A dictionary representing the morph targets in the geometry. The key is the morph targets name, the value its attribute index. This member is undefined by default and only set when morph targets are detected in the geometry.
Default is undefined.
An array of weights typically in the range [0,1] that specify how much of the morph is applied. This member is undefined by default and only set when morph targets are detected in the geometry.
Default is undefined.
Returns the local-space position of the vertex at the given index, taking into account the current animation state of both morph targets and skinning.
index | The vertex index.
---|---
target | The target object that is used to store the method's result.
Returns: The vertex position in local space.
Computes intersection points between a casted ray and this line.
raycaster | The raycaster.
---|---
intersects | The target array that holds the intersection points.
Overrides: Object3D#raycast
Sets the values of Mesh#morphTargetDictionary and Mesh#morphTargetInfluences to make sure existing morph targets can influence this 3D object.