log map, smaller maze

This commit is contained in:
2023-06-06 17:10:19 +02:00
parent d48500919a
commit 2075429566
2 changed files with 12 additions and 4 deletions

View File

@ -59,4 +59,10 @@ export default class MazeMesh extends THREE.InstancedMesh {
return -1 return -1
} }
} }
toString() {
return this.map.map(row =>
row.map(isWall => isWall? "██":"░░").join("")
).join("\n")
}
} }

10
main.js
View File

@ -14,10 +14,10 @@ import { Sky } from 'three/addons/objects/Sky.js';
import MazeMesh from './MazeMesh.js'; import MazeMesh from './MazeMesh.js';
const latitude = THREE.MathUtils.degToRad(35) const mazeLength = 23
const longitude = THREE.MathUtils.degToRad(25) const mazeWidth = 23
const mazeLength = 51 const latitude = THREE.MathUtils.degToRad(35)
const mazeWidth = 51 const longitude = THREE.MathUtils.degToRad(25)
let showGUI = window.location.search.includes("debug") let showGUI = window.location.search.includes("debug")
let showStats = window.location.search.includes("stats") let showStats = window.location.search.includes("stats")
@ -265,6 +265,8 @@ for ( let i=0; i<maze.count; i++ ) {
worldOctree.fromGraphNode( clone ) worldOctree.fromGraphNode( clone )
} }
console.log(String(maze))
// debug // debug
let stats, octreeHelper, gui let stats, octreeHelper, gui