https://github.com/chrispritchard/heightmaps
A collection of heightmap generators, along with some bmp/ppm image format savers
https://github.com/chrispritchard/heightmaps
bmp-format diamond-square-algorithm fsharp perlin-noise ppm-format sdl2 simplex-noise
Last synced: 8 months ago
JSON representation
A collection of heightmap generators, along with some bmp/ppm image format savers
- Host: GitHub
- URL: https://github.com/chrispritchard/heightmaps
- Owner: ChrisPritchard
- License: unlicense
- Created: 2019-03-14T19:43:35.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2019-05-19T22:33:10.000Z (over 6 years ago)
- Last Synced: 2025-03-10T21:54:06.345Z (11 months ago)
- Topics: bmp-format, diamond-square-algorithm, fsharp, perlin-noise, ppm-format, sdl2, simplex-noise
- Language: F#
- Size: 694 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Heightmaps
A collection of heightmap generators, along with some bmp/ppm image format savers.
No external libraries have been used (except for the SDL C library), so this project will hopefully serve as a good reference source for a raw F# implementation of these algorithms.
Currently, [Diamond Square](https://en.wikipedia.org/wiki/Diamond-square_algorithm), [Perlin noise](https://en.wikipedia.org/wiki/Perlin_noise) and [Simplex noise](https://en.wikipedia.org/wiki/Simplex_noise) have been implemented, with the [PPM format (P6)](https://en.wikipedia.org/wiki/Netpbm_format), [BMP format (24bit)](https://en.wikipedia.org/wiki/BMP_file_format) and a [SDL](https://en.wikipedia.org/wiki/Simple_DirectMedia_Layer) renderer. You can find the implementations of each in the appropriately named F# files - each file is completely self contained.
The project is a console app. It will take command-line arguments to configure (instructions can be seen by running it with 'help', or seeing the definition in the code [here](https://github.com/ChrisPritchard/Heightmaps/blob/master/Program.fs#L45).
If -bitmap or -ppm is *not* specified, the default is to render the generated image on a SDL surface. If so, the image can be regenerated using the R key, or the program can be quit using the escape key.
NOTE: some safe defaults, like the range reduction in diamond square and the perlin noise period cannot be set using the CLI tool. However, the algorithms are generally written so these variables are easy to override if needed.
The version of SDL shipped with this is for 64bit windows. Replacing the SDL.dll file with versions for other operating systems should work fine. Other versions can be found [here](https://www.libsdl.org/download-2.0.php).