I have been doing some test about adjusting and fixing textures for a matrix when generated at run time. I got errors and as I know there's something to fix here, I want this study to be a small contribution.
I made two textures, 128x128 and 256x128 sized. Later on, I run a program generating a different matrix each time using the DBpro sentence.
Then I checked how the texture was like and here are the results, I thing there is something to adjust !!!
Texture Width Height Tiles X Tiles Z Result Comments
128x128 50.000 5.000 10 10 OK? Rectangle 1:10 aprox.
128x128 50.000 5.000 100 10 OK Square !!!
128x128 10.000 5.000 20 10 OK Square !!!
256x128 10.000 5.000 20 10 WRONG Not the original Rectangle
256x128 10.000 10.000 20 10 WRONG Not the original rectangle
256x128 5.000 10.000 10 20 WRONG Not the original rectangle
256x128 10.000 10.000 10 20 OK!!! Just the original rectangle
256x128 5.000 10.000 10 10 WRONG Not the original rectangle
Result: It looks like the Z and X axis are interchanged when we try to set the tiles number.