Ok, here's what I have:
sync on
sync rate 45
show mouse
autocam off
`loading matrix and heightmap
`make matrix using height map
load image "101.bmp",1
`mat#,wid,hei,Xseg,Zseg
make matrix 1,1000,1000,100,100
`mat#,img#,Xseg,Zseg,scale
matrix_heightmap(1,1,100,100,3)
update matrix 1
`tryin' to texture matrix
load image "landscape100.bmp",2
`mat3,img#,acr,dwn
prepare matrix texture 1,2,100,100
iTile = 1
`seg down
for iZ = 0 to 99
`seg across
for iX = 0 to 99
set matrix tile 1,iX,(99-iZ),iTile
inc iTile
next iX
next iZ
update matrix 1
position camera camera position x(),400,camera position z()
do
a#=wrapvalue(a#+1)
position camera 500+(sin(a#)*500),camera position y(),500+(cos(a#)*500)
cmXpstn#=camera position X() : cmYpstn#=camera position Y() : cmZpstn#=camera position Z()
point camera 500,0,500
set cursor 0,0
print "FPS:" : print screen fps()
print "CamX:" : print cmXpstn# : print "CamY:" : print cmYpstn# : print "CamZ:" : print cmZpstn#
if spacekey() = 1
Position Camera Camera Position X(),Camera Position Y()+0.1,Camera Position Z()
endif
sync
loop
function matrix_heightmap(matnumber,imgnumber,x,y,scale)
make memblock from image 1,imgnumber
k=0
for i=0 to x
for j=0 to y
`text i*10,(y-j)*10,str$((memblock word(1,12+(k*2)))*0.001)
set matrix height matnumber,j,(x-i),(memblock word(1,12+(k*2)))*0.001*scale
k=k+1
next j
next i
endfunction
now when I do this:
`loading matrix and heightmap
`make matrix using height map
load image "201.bmp",1
`mat#,wid,hei,Xseg,Zseg
make matrix 1,1000,1000,200,200
`mat#,img#,Xseg,Zseg,scale
matrix_heightmap(1,1,200,200,3)
update matrix 1
`tryin' to texture matrix
load image "landscape200.bmp",2
`mat3,img#,acr,dwn
prepare matrix texture 1,2,200,200
iTile = 1
`seg down
for iZ = 0 to 199
`seg across
for iX = 0 to 199
set matrix tile 1,iX,(199-iZ),iTile
inc iTile
next iX
next iZ
or anything else to increase the texture resolution on the matrix I get a memblock out of range. How would I fix this?