Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

147
Visualizações
how do I load and play animated models with THREE.js

I'm having trouble loading animated .fbx models with three.js.

static loader :

loadStaticFBX(path){
        try{
            let loader = new FBXLoader()
            loader.load(path, (fbx) => {
                fbx.scale.setScalar(0.1);
                fbx.traverse(c => {
                  c.castShadow = true;
                })          
                this._scene.add(fbx)
            })
        }
        catch (err) {
            console.log("error loading: " + path + " into the scene")
            if (this._debug) {
                console.log(err)
            }
        }
    }

animated loader:

loadAnimatedFBX(modelPath, animPath){
        try {
            let loader = new FBXLoader()
            loader.load(modelPath, (fbx) => {
                fbx.scale.setScalar(0.1);
                fbx.traverse(c => {
                  c.castShadow = true;
                })          
                try{
                    let anim = new FBXLoader()
                    anim.load(animPath, (anim) => {
                        let m = new THREE.AnimationMixer(fbx)
                        this._mixers.push(m)
                        let idle = m.clipAction(anim.animations[0])
                        idle.play()
                    })
                }
                catch(err){
                    console.log("error loading the animation: " + animpath)
                    if (this._debug) {
                        console.log(err)
                    }
                }
                this._scene.add(fbx)
            })
        }
        catch(err){
            console.log("error loading the animated model: " + modelPath + " into the scene")
            if (this._debug) {
                console.log(err)
            }
        }
    }

the static loader works. For the animated loader there are no error messages logged and the model is loaded, it just that the animation isn't played.

about 4 years ago · Juan Pablo Isaza
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda