Time for action — adding animated scrolling

We can also make the scrolling of the texture dynamic. Let's do it:

  1. Create a new material and change the scroll attribute to animated scrolling:
    scroll_anim 0.01 0.01
    
  2. Remember to also change the used material of the manual object; otherwise, you won't see any changes.
  3. Compile and run the application. When you look carefully, you should see the texture moving from the upper-right to the lower-left corner. I can't show a picture of this because printing isn't yet able to show animations (maybe in the future).

What just happened?

We used another attribute to make the texture scroll. Besides the name, this attribute is almost similar to the scroll attribute, with the small, but important, difference that now the offset we set is per second.

There are many more attributes that we can use for manipulating a texture. A complete list can be found at http://www.ogre3d.org/docs/manual/manual_17.html#SEC9.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.145.12.3