Jump to content
Search Community

gsap tweenmax how to load gltf texture from left to right

johndoe1231 test
Moderator Tag

Recommended Posts

hey guys i am new to gsap and i am trying to make a left to right animation for my gltf model texture, hpwever, i cant seem to do that. currently i have a loaded model and texture and i am trying to make the texture go from left to right when loaded. is there anyway to do so? thanks in advance. have attached the code below and the part where i put the tweenlite code

 

 

 loader.load('scene.gltf', function ( gltf ) {
        
      var textureLoader = new THREE.TextureLoader();

      mesh = gltf.scene.children[0]

      console.log(mesh)

      var texture = textureLoader.load('white.jpg');
      texture.flipY = false;

      var matcapMaterial = new THREE.MeshMatcapMaterial({ skinning: true ,matcap: texture })

        obj = scene.add( mesh );

        obj.traverse((o) => {
        if (o.isMesh) o.material = matcapMaterial
        
        ;

        
        }
        
        
        )

        TweenLite.to(obj, 1, {x:100, ease:Linear.easeNone});

       
        ;


        mixer = new THREE.AnimationMixer( mesh );
        
        gltf.animations.forEach( ( clip ) => {
          
            mixer.clipAction( clip ).play();
          
        } );

      }
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...