var environment = new function(){} environment.init = function(){ window.scene && scene.camera.move({ "x": 500, "y": 1500, "z": 200, "rotationX": PI/2, "rotationY": PI }) map.center.a = scene.camera.x map.center.b = scene.camera.z clipper.rooms.push( new room ({ rect: new rect(-100,-100, 100,100), height: 400, })) clipper.rooms.push( new room ({ rect: new rect(100,100, 200,300), height: 400, })) clipper.rooms.push( new room ({ rect: new rect(200,300, 300,500), height: 400, })) clipper.rooms.push( new room ({ rect: new rect(300,100, 600,300), height: 400, })) clipper.rooms.push( new room ({ rect: new rect(400,200, 700,400), height: 400, })) builder.init() clipper.init() window.scene && scene.update() environment.update() } environment.update = function(t){ if (window.scene && scene.camera) { // map.center.a = scene.camera.x // map.center.b = -scene.camera.z } else { requestAnimationFrame(environment.update) } map.animate() z = false }