Change to onload execution
use onLoad instead of right away so the body dom element isn't null
This commit is contained in:
parent
1ebee3c8e5
commit
4a34761f72
@ -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();
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user