Object3D

Mesh

Class representing triangular polygon mesh based objects. Also serves as a base for other classes such as SkinnedMesh.

Example

var geometry = new v3d.BoxBufferGeometry(1, 1, 1); var material = new v3d.MeshBasicMaterial({ color: 0xffff00 }); var mesh = new v3d.Mesh(geometry, material); scene.add(mesh);

Constructor

Mesh(geometry : Geometry, material : Material)

geometry — (optional) an instance of Geometry or BufferGeometry. Default is a new BufferGeometry.
material — (optional) a single or an array of Material. Default is a new MeshBasicMaterial

Properties

See the base Object3D class for common properties.

.drawMode : Integer

Determines how the mesh triangles are constructed from the vertices. See the draw mode constants for all possible values. Default is TrianglesDrawMode.

.isMesh : Boolean

Used to check whether this or derived classes are meshes. Default is true.

You should not change this, as it is used internally for optimisation.

.geometry : Geometry

An instance of Geometry or BufferGeometry (or derived classes), defining the object's structure.

It's recommended to always use a BufferGeometry if possible for best performance.

.material : Material

An instance of material derived from the Material base class or an array of materials, defining the object's appearance. Default is a MeshBasicMaterial with a random color.

.morphTargetInfluences : Array

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.

.morphTargetDictionary : Object

A dictionary of morphTargets based on the morphTarget.name property. Undefined by default, but rebuilt updateMorphTargets.

Methods

See the base Object3D class for common methods.

.setDrawMode (value : Integer) : null

Set the value of drawMode.

.clone () : Mesh

Returns a clone of this Mesh object and its descendants.

.raycast (raycaster : Raycaster, intersects : Array) : null

Get intersections between a casted ray and this mesh. Raycaster.intersectObject will call this method.

.updateMorphTargets () : null

Updates the morphTargets to have no influence on the object. Resets the morphTargetInfluences and morphTargetDictionary properties.

Source

For more info on how to obtain the source code of this module see this page.