Okay I'm back with some examples on how to use a standard matrix. The Mesh stuff that people have posted above has nothing to do with this at all. I, for one, find the mesh stuff to be too complex for a newcomer, so I've broken down the steps of making a simple multi-textured matrix (that was your aim, correct?)
This first one will explain to you everything step by step as it happens. So it's like the program is telling you what it's doing. This one is meant for running, not learning from the code. The next one is for you to look at the code with
rem *************************
rem
rem MATRIX EXAMPLE
rem
rem **************************
rem Setup Demo
set display mode 640,480,32
Sync On
Sync Rate 60
autocam off
set text font "verdana"
set text size 16
set text to bold
set text opaque
PrintHelpText("Hello! This program is designed to help you understand how to texture different tiles on a matrix in different ways. To start, we will need a tiled image. This will hold ALL of the textures that we want to put on our matrix.","","")
PrintHelpText("Hmmm... How about we try to make a grassy landscape with a dirt path down the middle.","","HINT: We'll need a grass and a dirt texture for this one!")
rem Create a tiled image!
create bitmap 1,10,5
ink rgb(0,rnd(255),0),0
box 0,0,5,5
for d = 1 to 1000
ink rgb(0,rnd(255),0),0
dot rnd(5),rnd(5)
next d
ink rgb(rnd(155),0,0),0
box 5,0,10,5
for d = 1 to 1000
ink rgb(rnd(155),0,0),0
dot 5+rnd(5),rnd(5)
next d
get image 1,0,0,10,5
delete bitmap 1
rem Put a picture of the image up.
sprite 1,0,0,1
size sprite 1,100,100
PrintHelpText("This is a tiled image. The green side is the grass side, and the brown side is the dirt side. Tiled images can have as many different tiles as you want! You can easily make one in photoshop or a similar program.","","")
PrintHelpText("We will be using this image to make a grassy landscape with a dirt path going down the middle.","","")
rem hide our picture.
hide sprite 1
rem Make a matrix.
MAKE MATRIX 1,1000,1000,10,10
position camera 500,900,500
xrotate camera 90
PrintHelpText("Okay, here we have our matrix. It is 1000 units across and 1000 units down. That's its size. As for its tiles, it has 10 tiles that we can texture going across, and 10 going down!","","")
PrintHelpText("Each tile or square that you see can be filled with any texture we want!","","")
PrintHelpText("Alright. Now to texture it. Before we make a dirt path, we must first prepare the matrix for its texture. We do this with the PREPARE MATRIX TEXTURE command. Here's the syntax of it:","PREPARE MATRIX TEXTURE Matrix Number, Image Number, # Of Tiles In The Texture Across, # Of Tiles In The Texture Down","")
PrintHelpText("For our example, we will write it like this:","PREPARE MATRIX TEXTURE 1,1,2,1","The first 1 is because the matrix number of our matrix is 1. The second 1 is the image number. The third and fourth numbers are 2 and 1 because the image that we made earlier has 2 tiles across and 1 down!")
Prepare matrix texture 1,1,2,1
PrintHelpText("There! Now it's all textured and ready to have a dirt path put on it.","","")
PrintHelpText("Now for the dirt path. We'll need the SET MATRIX TILE command for this one. Here's the syntax:","SET MATRIX TILE matrix number, X Tile, Z Tile, Tile Number","Our tile 1 is the grass. Our tile 2 is the dirt. The matrix has a total of 10 tiles across and 10 tiles down.")
PrintHelpText("Please note that when using this command you can only texture the tiles within this range: 0 to (number of tiles matrix has on that axi)-1.","","For us, the tiles 0,1,2,3,4,5,6,7,8,9 are all avaliable to texture on BOTH the X and Z axis.")
PrintHelpText("Now... Let's start our path down the middle. We will texture each tile going up the middle with a dirt texture. The middle tile on the X axis is 5 (10/2=5) so we'll make that our X tile. Our Z tile will go up by 1 staring at 0 and ending at 9.","","To see a change in any tiles, the UPDATE MATRIX command will need to be called.")
show sprite 1
PrintHelpText("So, with a FOR/ NEXT command going for the variable 'z' from 0 to 9, our tile code looks like this:","SET MATRIX TILE 1,5,z,2","Why 2? Because our dirt tile is tile 2 remember!")
hide sprite 1
for z = 0 to 9
set matrix tile 1,5,z,2
update matrix 1
PrintHelpText("CYCLING VARIABLE Z... CURRENT CODE:","SET MATRIX TILE 1,5,"+str$(z)+",2","")
next z
PrintHelpText("And that's all there is to it!","","")
PrintHelpText("Now we've got a dirt path going through the middle! I hope this helped!","","*If you have any questions feel free to E-Mail me (DarkFlame864@aol.com) or to respond to wherever I posted this. Thanks!")
end
function PrintHelpText(Text$,Syntax$,Extra$)
if Syntax$<>"" then Syntax$="SYNTAX: "+Syntax$
if extra$<>"" then extra$="*"+Extra$
WaitRelease()
do
ink rgb(255,0,0),0
PrintInBox(Text$,20,Screen height()/2-100,Screen width()-20,20)
ink rgb(0,255,0),0
PrintInBox(syntax$,20,Screen height()/2,Screen width()-20,20)
ink rgb(155,155,255),0
PrintInBox(extra$,20,Screen height()/2+100,Screen width()-20,20)
ink rgb(255,155,0),0
center text Screen width()/2,Screen height()-50,"PRESS ANY KEY TO CONTINUE."
if scancode()>0 then exit
sync
loop
endfunction
function WaitRelease()
while scancode()>0
endwhile
endfunction
function PrintInBox(T as string,Left,Top,Right,LineDist)
if Len(T)<1 then exitfunction
SQX=Left
SQY=Top
for c = 1 to Len(T)
SPACE=Text Width(Mid$(T,c-1))
if c>1 then SQX=SQX+SPACE
if SQX>=Right-Space
if mid$(T,c+1)<>" " and mid$(T,c+1)<>"" and mid$(T,c)<>" " then TEXT SQX,SQY,"-"
SQX=0 : SQY=SQY+LineDist
endif
Text SQX,SQY,Mid$(T,c)
next c
endfunction
===================================================================
If you want to see the actual code behind the demo, look at this:
rem Setup Demo
set display mode 640,480,32
Sync On
Sync Rate 60
autocam off
rem Create a tiled image!
create bitmap 1,10,5
ink rgb(0,rnd(255),0),0
box 0,0,5,5
for d = 1 to 1000
ink rgb(0,rnd(255),0),0
dot rnd(5),rnd(5)
next d
ink rgb(rnd(155),0,0),0
box 5,0,10,5
for d = 1 to 1000
ink rgb(rnd(155),0,0),0
dot 5+rnd(5),rnd(5)
next d
get image 1,0,0,10,5
delete bitmap 1
rem Make a matrix and make the camera look at it.
MAKE MATRIX 1,1000,1000,10,10
position camera 500,900,500
xrotate camera 90
rem Prepare the matrix's texture!
Prepare matrix texture 1,1,2,1
rem Now, set its tiles! (make the dirt path)
for z = 0 to 9
set matrix tile 1,5,z,2
update matrix 1
next z
rem Activate a loop so we can just stare at our matrix.
do
sync
loop
I hope this helps
All you need to do is apply a texture to the tile that is on the side of a cliff to get what you are wanting. Try it!