I can't fathom out the matrix shift commands. They correctly shift the textures but the heights are inverted! Also the first row or column is filled with image 2 from prepared texture instead of wrapping from other end of matrix.
i.e. if you have a mountain, it becomes a big pit on the first shift, then back to mountain on second shift, then a pit, e.t.c.
Try snippet below and you will get my drift. Move around with cursors, space bar to activate shift.
Please help!
sync on
randomize timer()
autocam off
create bitmap 1,128,128
ink rgb(255,0,0),rgb(0,0,0)
box 0,0,64,64
ink rgb(0,255,0),rgb(0,0,0)
box 64,0,128,64
ink rgb(0,0,255),rgb(0,0,0)
box 0,64,64,128
ink rgb(0,0,0),rgb(0,0,0)
box 64,64,128,128
get image 1,0,0,128,128
delete bitmap 1
make matrix 1,1000,1000,32,32
prepare matrix texture 1,1,2,2
for f=0 to 31
for g=0 to 31
set matrix tile 1,f,g,rnd(3)+1
next g
next f
position camera 50,0,50
set matrix height 1,2,5,40
set matrix height 1,1,8,20
for f=10 to 20
set matrix height 1,f,15,15
set matrix height 1,15,f,15
next f
set matrix 1,0,0,1,1,1,1,1
update matrix 1
do
if inkey$()=" "
shift matrix down 1
update matrix 1
wait 200
endif
if upkey()
move camera 0.5
endif
if downkey()
move camera -0.5
endif
if rightkey()
yrotate camera wrapvalue(camera angle y()+0.5)
endif
if leftkey()
yrotate camera wrapvalue(camera angle y()-0.5)
endif
h#=get ground height(1,camera position x(),camera position z())
position camera camera position x(),h#+20,camera position z()
sync
loop
I love it when a plan comes together