Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

加载fbx模型动画无法播放,也没有报错,请帮忙解答 #559

Open
lzshenpan opened this issue Nov 30, 2022 · 1 comment
Open

Comments

@lzshenpan
Copy link

   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
            }
        });
@deyihu
Copy link
Collaborator

deyihu commented Nov 30, 2022

请给个完整得例子

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants