diff --git a/examples/js/loaders/GLTFLoader.js b/examples/js/loaders/GLTFLoader.js index e1064f55b3b9d67debf6726f942898cfd6a299fb..1b8b3e0b0d71e8b7128e049c37e0f2da14bbfe7b 100644 --- a/examples/js/loaders/GLTFLoader.js +++ b/examples/js/loaders/GLTFLoader.js @@ -107,6 +107,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 ]; @@ -174,15 +183,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 ) {