使用此代码:
var geometry = new THREE.Geometry()
geometry.vertices.length = 0
geometry.faces.length = 0
geometry.vertices.push(new THREE.Vector3(0, 0, 0))
geometry.vertices.push(new THREE.Vector3(0, 0, 32))
geometry.vertices.push(new THREE.Vector3(0, 32, 32))
geometry.vertices.push(new THREE.Vector3(0, 32, 0))
geometry.faces.push(new THREE.Face4(0, 1, 2, 3))
var wireMaterial = new THREE.MeshBasicMaterial({
color : 0xffffff,
wireframe : true
})
var grassMaterial = new THREE.MeshLambertMaterial( { map: THREE.ImageUtils.loadTexture("grass.png") } )
var grassFaceMaterial = new THREE.MeshFaceMaterial([grassMaterial])
scene.add(new THREE.Mesh( geometry, grassFaceMaterial ))
使用wireMesh
正常:
但尝试使用纹理网格grassFaceMaterial
作为最后一行中的材质会产生错误: