We use cookies to ensure that we give you the best experience on our website. If you continue to use this site we will assume that you are happy with it.

Animations from .gltf file

Home Forums Programming Animations from .gltf file

Tagged: 

Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #1991
    lexan1982
    Participant

    Hi, i have scene with animations. By user click i replacing some mesh. For this i removing old mesh from the v3dApp.scene. Then i load new .gltf file with v3dApp.loader and add it to the scene. But this model’s animation do not work.

    How could i add Animations from gltf.animation[] to the exists v3dApp.mixer?

    Thank you.

    first do it, then do it right, then do it better.

    #1997

    Hi,
    can you attach some minimal example (preferably, a zipped application folder) so that we can take a look?

    Chief 3D Verger | LinkedIn | Twitter

    #1998
    lexan1982
    Participant

    1. I load new .gltf model with loader:

           const loader = window.v3dApp.loader;
            const url = ${Config.RESOURCES_URL + item.pathToModel}/scene.gltf
    
            // Load a glTF resource
            loader.load( url, gltf => {
    
                console.log('animations', gltf.animations); // Array<v3d.AnimationClip>
                console.log('scene', gltf.scene);           // v3d.Scene
    
                this.props.setPart(item, gltf);
            } );

    2. Then i add new mesh to the Scene:

        const group = window.v3dApp.scene.getObjectByName(pivotName);
    
         group.add(gltf.scene);
    

    3. But i do not know what to do with:

    gltf.animations[]

    first do it, then do it right, then do it better.

    #2136

    Hello,
    Sorry for the delay. I made a quick test to see if animation works for dynamically loaded scenes. It actually works, so I guess the problem somewhere in your code. Why are you loading with v3dApp.loader and not with app.load(url, loadCb)?

    Chief 3D Verger | LinkedIn | Twitter

    #2138
    lexan1982
    Participant

    Do you see new Animations from new model at the v3dApp.mixer ?

    first do it, then do it right, then do it better.

    #2144
    xfish3
    Participant

    I, too, like a beginner, still have questions.
    Yuri, could you make a lesson with an example of creating a simple application on Verge3D? At least for example with one cube, which begins to rotate immediately after loading and one monkey, starting to rotate after clicking on it.
    It is very desirable that the lesson be a video. To make it clearer, where to begin the development process.

    #2146

    We’ll definitely do some lessons. For now you can watch this very helpful tutorial: https://www.youtube.com/watch?v=K-YlwMlVV6A which covers some basics. Also check out the Beginner Guide

    Chief 3D Verger | LinkedIn | Twitter

    #2147
    xfish3
    Participant

    Thank you! A great lesson!

Viewing 8 posts - 1 through 8 (of 8 total)
  • You must be logged in to reply to this topic.