I was given this function a while back which smooths a matrix.
the paramters of the function show what to do in order to use it.
function smooth_matrix(matnum,tilex,tilez,times)
for multiple=1 to times
for x=1 to tilex-1
for z=1 to tilez-1
a=get matrix height(matnum,x-1,z+1)
b=get matrix height(matnum,x,z+1)
c=get matrix height(matnum,x+1,z+1)
d=get matrix height(matnum,x+1,z)
e=get matrix height(matnum,x+1,z-1)
f=get matrix height(matnum,x,z-1)
g=get matrix height(matnum,x-1,z-1)
h=get matrix height(matnum,x-1,z)
total=a+b+c+d+e+f+g+h
av#=total/8
set matrix height matnum,x,z,av#
next z
next x
next multiple
for x=0 to tilex
set matrix height matnum,x,0,get matrix height(matnum,x,1)
next x
for x=0 to tilex
set matrix height matnum,x,tilez,get matrix height(matnum,x,tilez-1)
next x
for z=0 to tilez
set matrix height matnum,0,z,get matrix height(matnum,1,z)
next z
for z=0 to tilez
set matrix height matnum,tilex,z,get matrix height(matnum,tilex-1,z)
next z
update matrix matnum
endfunction
If no-one gives your an answer to a question you have asked, consider:- Is your question clear.- Did you ask nicely.- Are you showing any effort to solve the problem yourself