Mesh 网格

—> Object3D

function Mesh( geometry, material ) { } var geometry = new THREE.BoxGeometry(6, 6, 6), geometry2 = new THREE.SphereGeometry(4, 40, 40), geometry3 = new THREE.TorusKnotGeometry(4, 1, 100, 20), material = new THREE.MeshLambertMaterial({color: 0xff9900, wireframe: true}); var cube = new THREE.Mesh(geometry, material), sphere = new THREE.Mesh(geometry2, material), torusKnot = new THREE.Mesh(geometry3, material); scene.add(cube); scene.add(sphere); scene.add(torusKnot);

Attributes

type : String

Default value : Mesh
Description : 类型.

isMesh : Boolean

Default value : true (只读)
Description : 类型是否为Mesh.

geometry : Geometry

Default value : new BufferGeometry()
Description : 几何形状. mesh.geometry.dispose(); mesh.geometry = new THREE.Geometry(); mesh.geometry.verticesNeedUpdate = true; mesh.geometry.normalsNeedUpdate = true; mesh.geometry.colorsNeedUpdate = true;

material : Material

Default value : new MeshBasicMaterial( { color: Math.random() * 0xffffff } )
Description : 材质. mesh.material.visible = false; mesh.material.needsUpdate = true;

drawMode : Integer ( THREE.TrianglesDrawMode, THREE.TriangleStripDrawMode, THREE.TriangleFanDrawMode )

Default value : THREE.TrianglesDrawMode
Description : 三角形绘制方式, 几何模型中的顶点怎么绘制成网格的三角形.

Methods

raycast( raycaster, intersects )
raycaster Raycaster 光线投掷者
intersects Array 相交

求射线与网格的交点, Raycaster.intersectObject 调用这方法.

setDrawMode( value ) : null
value Integer 三角形绘制方式

设置三角形绘制方式.

updateMorphTargets( ) : null

更新变形目标, 重置 morphTargetInfluences 和 morphTargetDictionary.