diff --git a/examples/models/pump.dae b/examples/models/collada/pump/pump.dae similarity index 100% rename from examples/models/pump.dae rename to examples/models/collada/pump/pump.dae diff --git a/examples/models/pump_body.jpg b/examples/models/collada/pump/pump_body.jpg similarity index 100% rename from examples/models/pump_body.jpg rename to examples/models/collada/pump/pump_body.jpg diff --git a/examples/models/pump_gears.jpg b/examples/models/collada/pump/pump_gears.jpg similarity index 100% rename from examples/models/pump_gears.jpg rename to examples/models/collada/pump/pump_gears.jpg diff --git a/examples/models/pump_metalreflect.jpg b/examples/models/collada/pump/pump_metalreflect.jpg similarity index 100% rename from examples/models/pump_metalreflect.jpg rename to examples/models/collada/pump/pump_metalreflect.jpg diff --git a/examples/webgl_loader_collada_keyframe.html b/examples/webgl_loader_collada_keyframe.html old mode 100755 new mode 100644 index 6da6ab373351619d07fb9a74b00a8231c4146c80..e27279b894748ae18a1fb8a9828de658bb4725e9 --- a/examples/webgl_loader_collada_keyframe.html +++ b/examples/webgl_loader_collada_keyframe.html @@ -58,7 +58,7 @@ startTime, progress = 0; - loader.load( './models/pump.dae', function( collada ) { + loader.load( './models/collada/pump/pump.dae', function ( collada ) { model = collada.scene; animations = collada.animations; @@ -109,9 +109,9 @@ // Grid - var line_material = new THREE.LineBasicMaterial( { color: 0xcccccc, opacity: 0.2 } ), - geometry = new THREE.Geometry(), - floor = -0.04, step = 1, size = 14; + var material = new THREE.LineBasicMaterial( { color: 0xcccccc, opacity: 0.2 } ); + var geometry = new THREE.Geometry(); + var floor = -0.04, step = 1, size = 14; for ( var i = 0; i <= size / step * 2; i ++ ) { @@ -122,7 +122,7 @@ } - var line = new THREE.Line( geometry, line_material, THREE.LinePieces ); + var line = new THREE.Line( geometry, material, THREE.LinePieces ); scene.add( line ); // Add the COLLADA @@ -139,7 +139,7 @@ // Renderer - renderer = new THREE.WebGLRenderer(); + renderer = new THREE.WebGLRenderer( { antialias: true } ); renderer.setSize( window.innerWidth, window.innerHeight ); container.appendChild( renderer.domElement ); @@ -154,40 +154,40 @@ function start() { - for ( var i = 0, il = kfAnimations.length; i < il; ++i ) { + for ( var i = 0, il = kfAnimations.length; i < il; ++i ) { - var animation = kfAnimations[i]; + var animation = kfAnimations[i]; - for ( var h = 0, hl = animation.hierarchy.length; h < hl; h++ ) { + for ( var h = 0, hl = animation.hierarchy.length; h < hl; h++ ) { - var keys = animation.data.hierarchy[ h ].keys, - sids = animation.data.hierarchy[ h ].sids, - obj = animation.hierarchy[ h ]; + var keys = animation.data.hierarchy[ h ].keys, + sids = animation.data.hierarchy[ h ].sids, + obj = animation.hierarchy[ h ]; - if ( keys.length && sids ) { + if ( keys.length && sids ) { - for ( var s = 0; s < sids.length; s++ ) { + for ( var s = 0; s < sids.length; s++ ) { - var sid = sids[ s ], - next = animation.getNextKeyWith( sid, h, 0 ); + var sid = sids[ s ], + next = animation.getNextKeyWith( sid, h, 0 ); - if ( next ) { - next.apply( sid ); - } - } + if ( next ) next.apply( sid ); - obj.matrixAutoUpdate = false; - animation.data.hierarchy[ h ].node.updateMatrix(); - obj.matrixWorldNeedsUpdate = true; + } - } + obj.matrixAutoUpdate = false; + animation.data.hierarchy[ h ].node.updateMatrix(); + obj.matrixWorldNeedsUpdate = true; - } + } - animation.play( false, 0 ); + } + + animation.play( false, 0 ); lastTimestamp = Date.now(); - } + } + } function animate( timestamp ) { @@ -196,23 +196,24 @@ if ( progress >= 0 && progress < 48 ) { - for ( var i = 0, il = kfAnimations.length; i < il; ++i ) { + for ( var i = 0, il = kfAnimations.length; i < il; ++i ) { - kfAnimations[ i ].update( frameTime ); + kfAnimations[ i ].update( frameTime ); - } + } - } else if ( progress >= 48 ) { + } else if ( progress >= 48 ) { - for ( var i = 0, il = kfAnimations.length; i < il; ++i ) { + for ( var i = 0, il = kfAnimations.length; i < il; ++i ) { - kfAnimations[ i ].stop(); + kfAnimations[ i ].stop(); - } + } - progress = 0; - start(); - } + progress = 0; + start(); + + } progress += frameTime; lastTimestamp = timestamp;