diff options
author | Aki <please@ignore.pl> | 2021-04-01 21:48:49 +0200 |
---|---|---|
committer | Aki <please@ignore.pl> | 2021-04-01 21:48:49 +0200 |
commit | 65c0aaec15b0921a4d80354ed2ac23b8f58c52bc (patch) | |
tree | 7cbd7286b829c8ed272fbdea1bffffd704411e8d | |
parent | 01e0f6d262e0a13fe83eed256ebe49f0dc84965b (diff) | |
download | derelict-prototype-65c0aaec15b0921a4d80354ed2ac23b8f58c52bc.zip derelict-prototype-65c0aaec15b0921a4d80354ed2ac23b8f58c52bc.tar.gz derelict-prototype-65c0aaec15b0921a4d80354ed2ac23b8f58c52bc.tar.bz2 |
Adjusted camera and scaling
-rw-r--r-- | derelict.js | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/derelict.js b/derelict.js index b4b686e..0745ccb 100644 --- a/derelict.js +++ b/derelict.js @@ -34,12 +34,13 @@ function load(callback) { } function init() { - camera = new THREE.PerspectiveCamera(70, window.innerWidth / window.innerHeight, 0.01, 10) - camera.position.set(1, 1, 1) + camera = new THREE.PerspectiveCamera(80, window.innerWidth / window.innerHeight, 0.1, 100) + camera.position.set(8, 8, 8) camera.lookAt(0, 0, 0) scene = new THREE.Scene() - const helper = new THREE.AxesHelper(1) - scene.add(helper) + + const grid = new THREE.GridHelper(30, 30) + scene.add(grid) scene.add(Wreck(1, 0, 0)) scene.add(Wreck(1, 2, -1)) @@ -54,8 +55,8 @@ function init() { renderer2d.domElement.style.top = '0px' document.body.appendChild(renderer2d.domElement) const controls = new OrbitControls(camera, renderer2d.domElement) - controls.minDistance = 0.5 - controls.maxDistance = 8 + controls.minDistance = 2 + controls.maxDistance = 24 window.addEventListener('resize', onWindowResize) } |