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 4 of 4

Thread: Tiled Textures

  1. #1
    Guest

    Tiled Textures

    Hello,

    when I'm scaling a Block or something that is Texturemapped, OpenGL stretch the Picture. Is there a way to tile it?

    Sorry for my bad english, I hope you could understand my problem.

  2. #2
    Guest

    Re: Tiled Textures

    You have to change the texture coordinates.

  3. #3
    Senior Member OpenGL Guru
    Join Date
    Feb 2000
    Location
    Sweden
    Posts
    3,115

    Re: Tiled Textures

    You can scale the texture matrix the same way you scale the object.
    Code :
    glMatrixMode(GL_MODELVIEW);
    glScale(S, S, S);
    glMatrixMode(GL_TEXTURE);
    glScale(S, S, S);
    [This message has been edited by Bob (edited 06-05-2001).]

  4. #4
    Junior Member Newbie
    Join Date
    Dec 1969
    Location
    Munich,Germany
    Posts
    15

    Re: Tiled Textures

    glTexParamteri(GL_TEXTURE_2D,GL_TEXTURE_WRAP_S,GL_ REPEAT)
    glTexParamteri(GL_TEXTURE_2D,GL_TEXTURE_WRAP_t,GL_ REPEAT)
    that should tile your texture instead of stretching it. you have to set your texture coordinates larger than 1.0 e.g. if you set them 0.0-5.0 the texture will be repated 5 times

    Chris
    yes

Posting Permissions

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