diff --git a/dist/img/2.hdr b/dist/img/2.hdr new file mode 100644 index 000000000..2bf458438 Binary files /dev/null and b/dist/img/2.hdr differ diff --git a/src/index.ts b/src/index.ts index c176f57ec..6a4d915af 100644 --- a/src/index.ts +++ b/src/index.ts @@ -16,10 +16,8 @@ window.addEventListener("DOMContentLoaded", () => { if (canvas == null) return; const scene = new THREE.Scene(); - - const camera = new THREE.PerspectiveCamera( - 30, canvas.clientWidth/canvas.clientHeight, 0.1, 20); - camera.position.set(0.0, 0.9, -4.0) + const camera = new THREE.PerspectiveCamera( 70, canvas.clientWidth/canvas.clientHeight, 0.1, 2000); + camera.position.set(0, 1, -1.5) camera.rotation.set(0.0, Math.PI, 0.0) camera.lookAt(new THREE.Vector3(0, 0, 0)); @@ -115,7 +113,7 @@ window.addEventListener("DOMContentLoaded", () => { const ambientLight = new THREE.AmbientLight(0x333333); scene.add(ambientLight); - const floor = new Mesh( + let floor = new Mesh( new BoxGeometry(50, 100), new MeshLambertMaterial({ color: 0xffffff, @@ -140,18 +138,7 @@ window.addEventListener("DOMContentLoaded", () => { const ambientLight = new THREE.AmbientLight(0x333333); scene.add(ambientLight); - //const floor = new Mesh( - // new BoxGeometry(50, 100), - // new MeshLambertMaterial({ - // color: 0xffffff, - // depthWrite: true, - // }) - //); - //floor.position.y = -1.0; - //floor.rotation.x = -Math.PI / 2; - //scene.add(floor); - - const grid = new GridHelper(50, 100, 0xffffff, 0xffffff); + let grid = new GridHelper(500, 1000, 0xffffff, 0xffffff); scene.add(grid); grid.position.set(Math.round(0), 0, Math.round(0)); scene.fog = new Fog(0xffffff, 3, 20); @@ -249,11 +236,7 @@ window.addEventListener("DOMContentLoaded", () => { let hdr_r = 0; function hdr_s() { - if (hdr_r == 0) { - hdr_r = 1; - } else { - hdr_r = 0; - } + if (hdr_r >= 2) { hdr_r = 0; } else { hdr_r++; }; let hdr = "/img/" + hdr_r + ".hdr"; new RGBELoader().load(hdr, function (texture) { texture.mapping = THREE.EquirectangularReflectionMapping;