Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function criarAnimacao() {
- var loader = new THREE.GLTFLoader();
- loader.load('../CutleryFatctoryDesign/Utils/ImportObjects/maquinaanimada.gltf', function(gltf) {
- var a = 0;
- gltf.scene.scale.set(0.1, 0.1, 0.1);
- gltf.scene.position.set(120, 30, 195);
- gltf.scene.rotation.y += 1.6;
- const animation=gltf.animations[0];
- const mixer = new THREE.AnimationMixer(gltf.scene);
- mixers.push(mixer);
- const action = mixer.clipAction(animation);
- action.play();
- scene.add(gltf.scene);
- var clonee= gltf.scene.clone();
- clonee.position.set(120,30,250);
- const mixer2 = new THREE.AnimationMixer(clonee);
- mixers.push(mixer2);
- const action2 = mixer2.clipAction(animation);
- action2.play();
- scene.add(clonee);
- animate();
- }, undefined, function(error) {
- console.error(error);
- });
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement