How to use texture transform in script?

Scripting
API Documentation
Reactive Programming
Is there an example of how we can use texture transform in script?
Asked about 4 months ago by Aw
4 Votes2 FollowersSeen by 56
  • Featured Answer
    • Spark AR Team
       
      Here is an example:

      const Materials = require('Materials');

      Promise.all([
      Materials.findFirst('material0')
      ]).then(([material0]) => {
      // Assumes material with texture setup as diffuse
      // and attached to a plane

      // Scale, offset and rotation properties allow you
      // to move, rotate and scale texture within the
      // material

      // Scaling example:
      material0.diffuseTextureTransform.scaleU = 2;
      material0.diffuseTextureTransform.scaleV = 2;
      });

      Let us know how else we can help!
      • woah, that is really helpful, thanks!
        Posted about a month ago by Aw
  • This question has been closed.