Animation 向现有mixamo FBX models three.js添加不同的动画
我已经从教程中复制了用于将动画(mixamo中的舞蹈twerk)加载到现有fbx模型(mixamo中的Douglas)的代码,但它不起作用,因为SimonDev使用three.js的118版,而我使用的是128版Animation 向现有mixamo FBX models three.js添加不同的动画,animation,three.js,mixamo,Animation,Three.js,Mixamo,我已经从教程中复制了用于将动画(mixamo中的舞蹈twerk)加载到现有fbx模型(mixamo中的Douglas)的代码,但它不起作用,因为SimonDev使用three.js的118版,而我使用的是128版 const loader = new FBXLoader(); //load model loader.setPath('../models/characters/'); loader.load('Douglas.fbx', (fbx) => { //scale the
const loader = new FBXLoader();
//load model
loader.setPath('../models/characters/');
loader.load('Douglas.fbx', (fbx) => {
//scale the model down
fbx.scale.setScalar(0.0115);
/*
fbx.traverse(c => {
c.castShadow = true;
});
*/
//animate character
const anim = new FBXLoader();
anim.setPath('../models/characters/animations/');
anim.load('Twerk.fbx', (anim) => {
this.walkMixer = new THREE.AnimationMixer(anim);
//creates animation action
const walk = this.walkMixer.clipAction(anim.animations[0]);
walk.play();
});
this.object.add(fbx);
});
这在我的更新功能中
//animation
if (this.walkMixer) {
this.walkMixer.update(this.clock.getDelta());
}
以前,当动画与模型和gltf是同一个模型时,动画工作,但我正在尝试将模型和动画分开,以便可以应用mixamo中的不同动画。
我的代码根本不加载动画,他只是站在一个T形姿势。我不知道从mixamo加载单独动画到当前fbx模型的当前代码是什么。我想知道怎么做,因为我想在同一个模型上加载和播放多个动画。我设法解决了它->这是因为我有多个导入的three.js