Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

146
Vistas
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 la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda