Time for action — scrolling a texture

Now that we have prepared our quad, let's scroll the texture:

  1. Add the following line into the texture block of the material to scroll the texture:
    scroll 0.8 0.8
    
  2. Compile and run the application. This time, you should see a different part of the texture.
    Time for action — scrolling a texture

What just happened?

The scroll attribute changes the texture coordinates with the given offset. The following is a diagram showing the effect of scrolling. The upper-right corner was the first part of the texture we rendered and the lower-left corner was the part of the texture we rendered with the scroll applied.

This attribute can be used to change the texture ...

Get Ogre 3D 1.7 now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.