Change to onload execution

use onLoad instead of right away so the body dom element isn't null
This commit is contained in:
roblevesque 2016-07-07 11:35:52 -04:00 committed by GitHub
parent 1ebee3c8e5
commit 4a34761f72

View File

@ -19,8 +19,13 @@ var canvas_t=[];
var context_t=[]; var context_t=[];
var clock = new THREE.Clock(); var clock = new THREE.Clock();
var WIDTH = window.innerWidth , HEIGHT = window.innerHeight var WIDTH = window.innerWidth , HEIGHT = window.innerHeight
window.onload = function() {
init(); init();
animate(); animate();
render();
}
function init() { function init() {
scene = new THREE.Scene(); scene = new THREE.Scene();
@ -158,7 +163,6 @@ function render () {
renderer.render( scene, camera ); renderer.render( scene, camera );
} }
render();