in order to texture a matrix with more than one texture, you need to set up a texture previously, like the one I have attached. It can have as many textures on as you want, but they all need to be the same size.
After loading this texture into DB and creating a matrix to texture, you then have to call the command 'PREPARE MATRIX TEXTURE Matrix Number, Image Number, Across, Down'. what this command does is split up the texture into seperate texture, Across is how many across it is split into(2 in this example) and the Down is how many down it is split into(again, 2 in this example).
Then, to texture the matrix, you can use 'FILL MATRIX Matrix Number, Height, Tile Number' this sets every square in the matrix to the specified height and tile number. The tile number is a number given to the sections of the texture that DB split down into smaller textures. I have included some examples of this in the attatchment.
Alternatively, you can use 'SET MATRIX TILE Matrix Number, X, Z, Tile Number'. This textures the specified square with the specified tile number. This is the command I use in the example.
Finally, In DBPro you have to update the matrix using 'UPDATE MATRIX Matrix Number'. In DBC this isn't necessary, so you will have to take the update matrix from my code out for it to work properly in DBC.
`set up computer
sync on:sync rate 60
hide mouse
color backdrop 0
set ambient light 75
randomize timer()
`load image
load image "texture.bmp",1,0
`make matrix
make matrix 1,10000,10000,100,100
`set up the texture
prepare matrix texture 1,1,2,2
`update the matrix
ChangeMatrix(1)
`position camera
position camera 500,35,500
`main loop
do
`control
control camera using arrowkeys 0,2,2
`input
if returnkey()=1 and keypress=0 then ChangeMatrix(1):keypress=1
if returnkey()=0 then keypress=0
if spacekey()=1 then end
`instructions
text 0,0,"Use the arrowkeys to move."
text 0,20,"Press enter to change the matrix."
text 0,40,"Press space to exit."
`end loop
sync
loop
function ChangeMatrix(MatrixNo)
`randomize matrix
randomize matrix MatrixNo,30
`texture the matrix
for x=0 to 99
for z=0 to 99
set matrix tile MatrixNo,x,z,rnd(3)+1
next z
next x
`update matrix - take out if you are using DARKbasic Classic
update matrix MatrixNo
endfunction
Hope this helps
Part of solving the problem is actually noticing that the problem is there in the first place