Dude, I already helped- i gave you the code to do it, you just needed to find a 2D distance function in the code archives??
Radius=4
For X=cursorx-radius to cursorx+radius
for y=cursory-radius to cursory+radius
addheight=(radius-distance2D(x,y,cursorx,cursory))/Radius
heightmap[x,y]=heightmap[x,y]+addheight
next
next
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Distance func (nipped from Shagwanas code entry and modified for you!
Function Distance2D(x1,y1,x2,y2)
xDelta=abs(x2-x1)
yDelta=abs(y2-y1)
Return Sqr((XDelta*XDelta)+(YDelta*YDelta))
End Function
|