I use another system in my matrix editor :
I set the height of several tiles, and I stock their position in an array (I set 150-200 positions for a 100*100 tiles matrix), and then, I .. I don't know how explain it well in english ..
for each tile, excepted the ones which I chosen first, I set their height 1/6 * the height of all the tiles around it, and I do it until the matrix is as I want ...
here's the système I use in my matrix editor :
relax:
dim set(250,2)
for a = 1 to 50
set(a,1)=-3
set(a,2)=-3
next a
smoothed = 0
repeat
gosub keys
gosub cam
polyx = (size * object position x(1))/(segments*100)
polyz = (size * object position z(1))/(segments*100)
if inkey$()="s"
inc polySommet
set(polySommet,1) = polyx
set(polySommet,2) = polyz
backdrop off
input "Height of the polygon > ",height
backdrop on
set matrix height 1,polyx,polyz,height
update matrix 1
endif
print "Q pour valider"
print "S pour choisir ce polygone comme un sommet."
print "Vous pouvez encore placer ",250 - polySommet," sommets."
sync
until inkey$()="q"
dim newHeight#(segments,segments)
repeat
print "Maintenant, il faut relaxer la matrice..."
print "Pressez R pour relaxer la matrice."
print "Pressez T pour tronquer les sommets."
print "pressez return pour continuer à modeler votre matrice."
if inkey$()="r"
for x=2 to segments-1
for z=2 to segments-1
height1 = get matrix height(1,x-1,z-1)
height2 = get matrix height(1,x,z-1)
height3 = get matrix height(1,x+1,z-1)
height4 = get matrix height(1,x-1,z+1)
height5 = get matrix height(1,x,z+1)
height6 = get matrix height(1,x+1,z+1)
moyenne# = (height1 + height2 + height3 + height4 + height5 + height6) / 6
newHeight#(x,z) = moyenne#
next z
next x
for x=2 to segments-1
for z=2 to segments-1
possibleLever = 1
for sx = 1 to 250
if set(sx,1)=x and set(sx,2)=z then possibleLever = 0
next sx
if possibleLever = 1
set matrix height 1,x,z,newHeight#(x,z)
endif
next z
next x
update matrix 1
endif
if inkey$()="t"
for x=2 to segments-1
for z=2 to segments-1
height1 = get matrix height(1,x-1,z-1)
height2 = get matrix height(1,x,z-1)
height3 = get matrix height(1,x+1,z-1)
height4 = get matrix height(1,x-1,z+1)
height5 = get matrix height(1,x,z+1)
height6 = get matrix height(1,x+1,z+1)
moyenne# = (height1 + height2 + height3 + height4 + height5 + height6) / 6
newHeight#(x,z) = moyenne#
next z
next x
for x=2 to segments-1
for z=2 to segments-1
possibleLever = 0
for sx = 1 to 250
if set(sx,1)=x and set(sx,2)=z then possibleLever = 1
next sx
if possibleLever = 1
set matrix height 1,x,z,newHeight#(x,z)
endif
next z
next x
update matrix 1
endif
for t=1 to 10
gosub cam
print "Maintenant, il faut relaxer la matrice..."
print "Pressez R pour relaxer la matrice."
print "Pressez T pour tronquer les sommets."
print "pressez return pour continuer à modeler votre matrice."
next t
sync
until returnkey()=1
return
I'm the God who made the world in seven lines.
I'm the Evil who destroyed this world in one line.