mirror of
https://github.com/Nycto/PerlinNim
synced 2026-01-02 07:44:37 +00:00
No description
| .github/workflows | ||
| bin | ||
| src | ||
| tests | ||
| .gitignore | ||
| .gitmodules | ||
| LICENSE.md | ||
| nim.cfg | ||
| perlin.nimble | ||
| README.md | ||
PerlinNim
A noise generation library for Nim, with support for both Perlin noise and Simplex noise.
API Docs
http://nycto.github.io/PerlinNim/perlin.html
A Quick Example
import perlin, random, math
# Call randomize from the 'math' module to ensure the seed is unique
randomize()
let noise = newNoise()
# Output a 20x10 grid of noise
for y in 0..10:
for x in 0..20:
let value = noise.simplex(x, y)
# If you wanted to use Perlin noise, you would swap that line out with:
# let value = noise.perlin(x, y)
stdout.write( int(10 * value) )
stdout.write("\n")
License
This library is released under the MIT License, which is pretty spiffy. You should have received a copy of the MIT License along with this program. If not, see http://www.opensource.org/licenses/mit-license.php
