How would I tile a texture on an object?
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
use numbers bigger than 1.0 for your texture coordinates
...
ie
2.0 would tile the texture twice.
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.
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.