diff --git a/examples/js/loaders/GLTFLoader.js b/examples/js/loaders/GLTFLoader.js index 5f9db14865c342f41d8eb71299fe62478e1f22d0..a27800a6c0e483a83088892080140b20ddd034e5 100644 --- a/examples/js/loaders/GLTFLoader.js +++ b/examples/js/loaders/GLTFLoader.js @@ -108,6 +108,15 @@ THREE.GLTFLoader = ( function () { update: function ( scene, camera ) { + // update scene graph + + scene.updateMatrixWorld(); + + // update camera matrices and frustum + + camera.updateMatrixWorld(); + camera.matrixWorldInverse.getInverse( camera.matrixWorld ); + for ( var name in objects ) { var object = objects[ name ]; @@ -175,15 +184,6 @@ THREE.GLTFLoader = ( function () { // Update - update all the uniform values GLTFShader.prototype.update = function ( scene, camera ) { - // update scene graph - - scene.updateMatrixWorld(); - - // update camera matrices and frustum - - camera.updateMatrixWorld(); - camera.matrixWorldInverse.getInverse( camera.matrixWorld ); - var boundUniforms = this.boundUniforms; for ( var name in boundUniforms ) {