https://github.com/westonhanners/perlinnoisekit
Simple Objective-C class to generate 1,2, and 3D Perlin Noise
https://github.com/westonhanners/perlinnoisekit
Last synced: 12 days ago
JSON representation
Simple Objective-C class to generate 1,2, and 3D Perlin Noise
- Host: GitHub
- URL: https://github.com/westonhanners/perlinnoisekit
- Owner: WestonHanners
- Created: 2012-07-18T10:42:51.000Z (almost 13 years ago)
- Default Branch: master
- Last Pushed: 2014-11-10T15:04:48.000Z (over 10 years ago)
- Last Synced: 2025-04-01T16:33:26.644Z (about 1 month ago)
- Language: Objective-C
- Size: 253 KB
- Stars: 15
- Watchers: 1
- Forks: 2
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
Perlin Noise for Objective-C
============================
------------------------------------------------------This is a Perlin Noise Generator based on information from [Hugo Elias](http://freespace.virgin.net/hugo.elias/models/m_perlin.htm "Hugo Elias's Perlin Noise Page").
Usage:
------To use: Simply add PerlinNoise.h and PerlinNoise.m to your project.
You can initalize the class like this:
PerlinNoise *perlin = [[PerlinNoise alloc] initWithSeed:someint];
Then by calling one of the output functions you will recieve a float that is the PerlinNoise value for the input.
float n = [perlin perlin1DValueForPoint:x];
or
float n = [perlin perlin2DValueForPoint:x :y];
You can manipulate the output using the following properties.
- .seed (this is the number used to generate the output)
- .octaves (how many iterations the function should run)
- .persistance (this changes the frequency for the subsequent octaves)
- .scale (multiply the output by this number, the default output is between 0 and 1)
- .frequency (the distance between the returned values)
- .interpolationType (this can be kLinearInterpolation or kCosineInterpolation, CosineInterpolation is slower)
---------------------------------------------------------------
Thanks to Hugo Elias for his wonderful page about perlin noisehttp://freespace.virgin.net/hugo.elias/models/m_perlin.htm
Also thanks for my friend Tim Winter who always helps me find my bugs.