Skip to content

Commit 7aff8c8

Browse files
committed
updated GLTFLoader.js tp r147 and related code
1 parent e301b48 commit 7aff8c8

File tree

2 files changed

+2498
-2029
lines changed

2 files changed

+2498
-2029
lines changed

three.js/examples/nft.html

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,6 @@
146146
// copy projection matrix to camera
147147
camera.projectionMatrix.copy( arToolkitContext.getProjectionMatrix() );
148148
})
149-
console.log(arToolkitContext);
150149

151150
////////////////////////////////////////////////////////////////////////////////
152151
// Create a ArMarkerControls
@@ -174,11 +173,13 @@
174173
threeGLTFLoader.load("./resources/Flamingo.glb", function (gltf) {
175174
model = gltf.scene.children[0];
176175
model.name = 'Flamingo';
176+
const clips = gltf.animations;
177177

178178
var animation = gltf.animations[0];
179-
var mixer = new THREE.AnimationMixer(model);
179+
var mixer = new THREE.AnimationMixer(gltf.scene);
180180
mixers.push(mixer);
181-
var action = mixer.clipAction(animation);
181+
const clip = THREE.AnimationClip.findByName( clips, 'flamingo_flyA_' );
182+
var action = mixer.clipAction(clip);
182183
action.play();
183184

184185
root.matrixAutoUpdate = false;

0 commit comments

Comments
 (0)