summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-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)
}