From 65c0aaec15b0921a4d80354ed2ac23b8f58c52bc Mon Sep 17 00:00:00 2001 From: Aki Date: Thu, 1 Apr 2021 21:48:49 +0200 Subject: Adjusted camera and scaling --- derelict.js | 13 +++++++------ 1 file 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) } -- cgit v1.1