boj / ruby-perlin
- Source
- Commits
- Network (0)
- Issues (0)
- Downloads (0)
- Wiki (1)
- Graphs
-
Branch:
master
commit a6cf69fe34d02081a51ff6a5746af04658deadee
tree 1c933b4cdb67bc599c251f0d83adb6e8a4369f05
parent 2683941f58aa645c22bfe79bca2334a49b3b9f1e
tree 1c933b4cdb67bc599c251f0d83adb6e8a4369f05
parent 2683941f58aa645c22bfe79bca2334a49b3b9f1e
| name | age | message | |
|---|---|---|---|
| |
.gitignore | ||
| |
LICENSE | ||
| |
README.md | ||
| |
extconf.rb | ||
| |
perlin.c | ||
| |
test.rb |
README.md
Ruby Perlin
A Ruby Perlin implementation based off http://freespace.virgin.net/hugo.elias/models/m_perlin.htm
- Written by Brian 'bojo' Jones mojobojo@gmail.com
- Optimizations thanks to Camille Goudeseune, Univ of Illinois, cog@illinois.edu
INSTALL
$ ruby extconf.rb
$ make
Copy the module to wherever you wish to use it.
USAGE
require 'perlin'
# Takes values Seed, Persistence, and Octaves
p = Perlin.new(123, 1, 1)
# Returns a z value for (x, y)
puts p.run(10, 20)
# Returns an array of z's for range
# (x_start, y_start, x_end, y_end)
arr = p.return_chunk(0, 0, 16, 16)

