Thread: Tiled Texturing?

  1. #1
    Programming is fun, mkay?
    Join Date
    Oct 2001
    Posts
    490

    Question Tiled Texturing?

    How would I tile a texture on an object?
    Website(s): http://www16.brinkster.com/trifaze/

    E-mail: [email protected]

    ---------------------------------
    C++ Environment: MSVC++ 6.0; Dev-C++ 4.0/4.1
    DirectX Version: 9.0b
    DX SDK: DirectX 8.1 SDK

  2. #2
    Registered User
    Join Date
    Jan 2002
    Posts
    6
    use numbers bigger than 1.0 for your texture coordinates
    ...


    ie

    2.0 would tile the texture twice.

  3. #3
    Registered User VirtualAce's Avatar
    Join Date
    Aug 2001
    Posts
    9,607
    Do modulo math or use AND for powers of 2 - which all your textures should be.

    u&= (TextureSizeX-1);
    v&= (TextureSizeY-1);

    or

    u%=(TextureSizeX);
    v%=(TextureSizeY);

    Of course u and v must be integers to use this.

  4. #4
    Registered User VirtualAce's Avatar
    Join Date
    Aug 2001
    Posts
    9,607
    For DirectX, though, the SDK says to use values over 1.0 to tile the texture. My first post was for a different texturing scheme.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Textures not texturing the way I want
    By scwizzo in forum Game Programming
    Replies: 0
    Last Post: 12-16-2008, 12:12 PM
  2. OpenGL, texturing...and...more OpenGL
    By Sunny in forum Game Programming
    Replies: 2
    Last Post: 07-08-2002, 02:34 PM