summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorAki <please@ignore.pl>2021-04-01 21:48:49 +0200
committerAki <please@ignore.pl>2021-04-01 21:48:49 +0200
commit65c0aaec15b0921a4d80354ed2ac23b8f58c52bc (patch)
tree7cbd7286b829c8ed272fbdea1bffffd704411e8d
parent01e0f6d262e0a13fe83eed256ebe49f0dc84965b (diff)
downloadderelict-prototype-65c0aaec15b0921a4d80354ed2ac23b8f58c52bc.zip
derelict-prototype-65c0aaec15b0921a4d80354ed2ac23b8f58c52bc.tar.gz
derelict-prototype-65c0aaec15b0921a4d80354ed2ac23b8f58c52bc.tar.bz2
Adjusted camera and scaling
-rw-r--r--derelict.js13
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)
}