function updateMatrix(x,z)
remStart
Only do this if camera is nearing the edge of the visible matrix (ie. edgeOfMatrix-playerPosition<viewRange) or just run every few seconds
remEnd
for mX=x to x+30
for mZ=z to z+30
set matrix height 1,mX-x,mZ-z,terrainHeight(mX,mZ)
if mX<30 and mZ<30 then set matrix tile 1,mX-x,mZ-z,terrainTile(mX,mZ)
next mZ
next mX
update 1
position matrix 1,x*tileSize,0,z*tileSize
endfunction
function ground(x,z)
remStart
You will need to re-write get ground function to allow for the matrix offset from 0,0.
remEnd
gnd#=get ground height(1,x-(matrixOffsetX*tileSize),z-(matrixOffsetZ*tileSize)
endfunction gnd#
I hope these pointers help
Pneumatic of Xev@EQ
Life outside of MMORG's costs more, rewards less and features no end game content.