I've attempted to do a circular crater, added Bamber's normalisation too
sync on : sync rate 30 : autocam off : cls
gosub images
make matrix 1,1000,1000,20,20
position camera 500,500,-200
point camera 500,0,500
for x = 2 to 18
for z = 2 to 18
set matrix height 1,x,z,26
update matrix 1
next z
next x
prepare matrix texture 1,1,1,1
ink rgb(255,255,255),0
color backdrop rgb(0,0,0)
repeat
center text 320,0,"Press space to destroy land"
sync
until spacekey()=1
wait 100
for t=0 to 360 step 10
for depth = 0 to 5
x=10+sin(t)*depth : z=8+cos(t)*depth
set matrix height 1,x,z,(depth*4)-20
next depth
next t
Normalise(1)
update matrix 1
sync
end
images:
ink rgb(0,0,0),0
box 0,0,124,124
ink rgb(100,50,0),0
box 3,3,121,121
ink rgb(0,50,0),0
for t=0 to 1200
a=rnd(124) : b=rnd(124)
box a,b,a,b
next t
get image 1,0,0,124,124
return
`By Lee Bamber From DB Example - Adds shaded areas to matrix to give depth
Function Normalise(MatNum)
For z=1 to 18
For x=1 to 18
h8#=get matrix height(MatNum,x,z-1)*5:`*5 added for even more depth
h4#=get matrix height(MatNum,x-1,z)*5
h#=get matrix height(MatNum,x,z)*5
h2#=get matrix height(MatNum,x,z)*5
x1#=(x-1)*25.0
y1#=h#
x2#=(x+0)*25.0
y2#=h4#
dx#=x2#-x1#
dy#=y2#-y1#
ax#=atanfull(dx#,dy#)
ax#=wrapvalue(90-ax#)
z1#=(z-1)*25.0
y1#=h2#
z2#=(z+0)*25.0
y2#=h8#
dz#=z2#-z1#
dy#=y2#-y1#
az#=atanfull(dz#,dy#)
az#=wrapvalue(90-az#)
nx#=sin(ax#)
ny#=cos(ax#)
nz#=sin(az#)
Set matrix normal MatNum,x,z,nx#,ny#,nz#
next x
next z
Update Matrix MatNum
EndFunction
@INH
You put UPDATE MATRIX in the loop!
Your signature has been erased by a mod because it was rubbish.
