|
|
"Bald Eagle" <cre### [at] netscapenet> wrote:
> http://www.bluh.org/code-the-diamond-square-algorithm/
>
> discusses "wrapping" over the edge.
>
> http://www.mapeditor.org/ looked interesting if you're doing that kind of
> work.
I was thinking that if you assigned each tile a shade of gray, you could use the
value of each pixel to tell you what tiles to place.
here's some old code I wrote for the diamond square algorithm:
https://www.dropbox.com/s/wbr4h93jssm6pfn/dsquare.tar.gz?dl=0
comments are almost non-existant, and it's somewhat messy, but it's functional.
I included the makefile so you can build it easily.
usage is lScape5 width height
really, I could have just used one parameter, since the image has to be square.
Also, the dimensions have to be one pixel higher than a power of 2 for it to
work: eg. 257x257 or 513x513
Regards,
A.D.B.
Post a reply to this message
|
|