jscastro76 / threebox

A Three.js plugin for Mapbox GL JS, with support for animations and advanced 3D rendering.
Other
549 stars 145 forks source link

Using separate GLB files animation #420

Open lorenzoMezza opened 5 months ago

lorenzoMezza commented 5 months ago

Hello,

In my project, I'm faced with the necessity of having separate GLB files for animations, distinct from the GLB file containing the 3D model. I'm exploring how to effectively use these animations on the same model.

I've managed to successfully integrate animations when they're included in a single GLB file alongside the 3D model. With this code:

window.addEventListener('keydown', function(event) {
    if (event.keyCode === 32) 
        if (soldier) {
            soldier.playAnimation({ animation: 0, duration: 1000 });
        }
    }
});

However, in my scenario, I have multiple GLB files for different animations, with only one GLB file containing the 3d model itself and i need to be able to use all of those animations for the 3D model. what is the right way to accomplish this?