Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

145
Views
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
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!