Part of the Khronos Group
OpenGL.org

The Industry's Foundation for High Performance Graphics

from games to virtual reality, mobile phones to supercomputers

Results 1 to 2 of 2

Thread: Scrolling an image inside a texture

  1. #1
    Junior Member Newbie
    Join Date
    Jun 2000
    Location
    Toulouse, France
    Posts
    3

    Scrolling an image inside a texture

    What's the way to scroll an image (of any size) inside a texture using a Hardware method ?!
    Otherwise, what's the solution the cheapest ?!

    Thanx.

  2. #2
    Senior Member OpenGL Guru Relic's Avatar
    Join Date
    Apr 2000
    Posts
    2,527

    Re: Scrolling an image inside a texture

    Move the TexCoords to any number with s,t-wrap modes GL_REPEAT or use the texture matrix for translation of the texture space.

    The first means if you have a simple quad with texture coordinates from 0.0 to 1.0, add 0.1 to every coordinate to move the texture one tile in 10 steps.
    Texture coordinates from 1.0 to 2.0 show the identical image like 0.0 to 1.0 with wrap repeat. There is no need to have coordinates over 2.0 in this example.

    The other method is to select the texture matrix and issue glTranslate calls for the s,t components, without changing the glTexCoords.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •