From c6da699f18426079435ad4664e7c715386ff82c0 Mon Sep 17 00:00:00 2001 From: Jules Laplace Date: Mon, 28 Jan 2019 17:57:38 +0100 Subject: display a random face --- client/splash/renderer.js | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) (limited to 'client/splash/renderer.js') diff --git a/client/splash/renderer.js b/client/splash/renderer.js index e71a4526..ad111f1a 100644 --- a/client/splash/renderer.js +++ b/client/splash/renderer.js @@ -1,21 +1,15 @@ import * as THREE from 'three' -import { FOG_COLOR } from './constants' +import { FOG_COLOR, CAMERA_NEAR, CAMERA_FAR, CAMERA_X, CAMERA_Y, CAMERA_Z } from './constants' export const scene = new THREE.Scene() scene.fog = new THREE.Fog(FOG_COLOR, 2, 15) -export const camera = new THREE.PerspectiveCamera(35, window.innerWidth / window.innerHeight, 0.001, 15) -camera.position.set(3, 0.15, 3) - -// export const camera = new THREE.PerspectiveCamera(70, w / h, 1, 10000) -// camera.position.x = 0 -// camera.position.y = 0 -// camera.position.z = 200 +export const camera = new THREE.PerspectiveCamera(35, window.innerWidth / window.innerHeight, CAMERA_NEAR, CAMERA_FAR) +camera.position.set(CAMERA_X, CAMERA_Y, CAMERA_Z) export const renderer = new THREE.WebGLRenderer({ antialias: true, alpha: true }) renderer.setClearColor(scene.fog.color) -// renderer.setClearColor(0x000000, 0) renderer.setPixelRatio(window.devicePixelRatio) renderer.setSize(window.innerWidth, window.innerHeight) @@ -40,3 +34,8 @@ export function init() { export function render() { renderer.render(scene, camera) } + + +window.scene = scene +window.THREE = THREE + -- cgit v1.2.3-70-g09d2