maptalks.three
maptalks.three copied to clipboard
加载fbx模型动画无法播放,也没有报错,请帮忙解答
var loader = new THREE.FBXLoader();
let threeLayer = this.threeLayer
loader.load('/3dobj/test.fbx', object => {
console.log("object drone")
object.scale.set(5, 5, 5);
object.rotation.x = Math.PI / 2
object.mixer = new THREE.AnimationMixer(object);
// mixers.push(object.mixer);
var action = object.mixer.clipAction(object.animations[0]);
action.play()
object.traverse(function (child) {
if (child.isMesh) {
child.material.color.set("#ff0000")
child.material.side = THREE.DoubleSide
//发光材质
child.material.emissive = new THREE.Color(1, 1, 1)
child.material.emissiveIntensity = 0.5;
child.material.emissiveMap = child.material.map;
// this.childMesh = child
}
});