Step by Step Guide to Texturing a Matrix
first you must have an image, on this image there must be 2+ textures,such as this one
in your program you must first make your matrix and load the image with your textures on it
then the important bit
prepare matrix texture 1,1,2,2
the first 2 numbers specify which matrix and which image your going to use, the next two specify how you want the image to be split up, so 2 along the x axis and 2 along the y axis in this case. As 2*2 is 4 we now have 4 texture tiles we can use on our matrix.
(prepare matrix texture also textures the entire matrix with the top left texture in the image)
now we use the set matrix tile command
set matrix tile 1,10,10,4
that line textured the middle matrix tile(10,10) on matrix number one with tile texture number 4 whcih is the bottom right on that image. this command can be used in for-next loops totextures larger areas, aswell.
after doing anything to our matrix we must update it
so stick that at the end of your matrix set up code.
Heres an example program that shows you a textured matrix using the image above.
`Texturing a Matrix
`By ReD_eYe
sync on
sync rate 50
`make matrix
make matrix 1,1000,1000,20,20
`load image
load image "image.JPG",1
`split image up into 4 tiles and texture whole matrix with first tile
prepare matrix texture 1,1,2,2
`texture middle tile with last texture
set matrix tile 1,10,10,4
`update it so its visible
update matrix 1
`main loop
do
`camera control
control camera using arrowkeys 0,10,2
position camera camera position x(),100,camera position z()
`manual sync
sync
loop
just save the image above and save the code into the same directory and compile and run.
Also check out my 20 line competition entry, that allows you to make+texture a matrix very easily.
http://darkbasicpro.thegamecreators.com/?m=forum_view&t=14006&b=11
hope that helps, any problems/questions just ask