When implementing the following code:
let shape = new THREE.Geometry()
shape.vertices.length = 0
shape.faces.length = 0
shape.vertices.push(new THREE.Vector3(0, 0, 0))
shape.vertices.push(new THREE.Vector3(0, 0, 32))
shape.vertices.push(new THREE.Vector3(0, 32, 32))
shape.vertices.push(new THREE.Vector3(0, 32, 0))
shape.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( shape, grassFaceMaterial ))
the wireMesh
function performs as expected:
However, when attempting to utilize the textured mesh grassFaceMaterial
as the material in the final line of code, an error is generated: