diff --git a/MazeMesh.js b/MazeMesh.js index a2f7acb..791d678 100644 --- a/MazeMesh.js +++ b/MazeMesh.js @@ -12,19 +12,18 @@ export default class MazeMesh extends THREE.InstancedMesh { this.map = new Array(length).fill().map(() => new Array(width).fill(1)) this.start = new THREE.Vector3(width/2, .1, length/2) this.exit = new THREE.Vector3(Math.floor(width/2), 0, 1) - this.count = length * width - 2 this.dig(this.exit) this.dig(new THREE.Vector3(Math.floor(width/2), 0, 0)) this.build ( this.exit ) let matrix = new THREE.Matrix4() - let i=0 + this.count = 0 this.map.forEach((row, z) => { row.forEach((isWall, x) => { if (isWall) { matrix.setPosition( x + .5 - width/2, 0.5, z + .5 - length/2) - this.setMatrixAt( i, matrix ); - i++ + this.setMatrixAt( this.count, matrix ); + this.count++ } }) }) diff --git a/main.js b/main.js index 248fcb5..b82300e 100644 --- a/main.js +++ b/main.js @@ -322,8 +322,6 @@ const raftFaceMaterial = new THREE.MeshStandardMaterial({ roughnessMap: woodTexture, color: 0xFFFFFF, emissive: 0, - specular: 0x505050, - shininess: 1, bumpMap: woodTexture, bumpScale: .1, depthFunc: 3, @@ -338,8 +336,6 @@ const raftSideMaterial = new THREE.MeshStandardMaterial({ roughnessMap: woodTexture, color: 0xFFFFFF, emissive: 0, - specular: 0x505050, - shininess: 1, bumpMap: woodTexture, bumpScale: .1, depthFunc: 3,