#include <Noise.h>
Public Types | |
| enum | Interpolation { LINEAR, COSINE, CUBIC } |
Public Methods | |
| Perlin1D (double persistence=0.5, int octaves=1, Interpolation interpolation=LINEAR) | |
| Construct a new perline noise generator. | |
| void | setParameters (double persistence, int octaves) |
| Set the noise parameters. | |
| void | setInterpolation (Interpolation interpolation) |
| Set the interpolation method. | |
| void | setOffset (int idx) |
| Set the offset into the noise functions. | |
| void | randomize () |
| Randomize the offset. | |
| double | _simpleRandom (int x) const |
| A simple pseudo-random number regenator. | |
| double | _getSmoothedNoise (int x) |
| Get a weighted sum of adjacent random numbers to smooth the distribution. | |
| double | _linearInterpolate (double a, double b, double x) |
| Linear interpolation. | |
| double | _cosineInterpolate (double a, double b, double x) |
| Cosine interpolation. | |
| double | _cubicInterpolate (double v0, double v1, double v2, double v3, double x) |
| Cubic interpolation. | |
| double | _getInterpolatedNoise (double x) |
| Returns the noise value interpolated between the smoothed noise at successive points in the distribution. | |
| double | getValue (double x) |
| Get the noise vaule at a particular position. | |
| std::vector< float > | generate (int n, bool periodic, double scale=1.0, double amplitude=1.0, double offset=0.0) |
| Generate a list of noise values. | |
Many introductions to perlin noise and its uses are available online, via Google. Here's one such site:
http://freespace.virgin.net/hugo.elias/models/m_perlin.htm
|
|
|
|
||||||||||||||||
|
Construct a new perline noise generator.
|
|
||||||||||||||||
|
Cosine interpolation.
|
|
||||||||||||||||||||||||
|
Cubic interpolation.
|
|
|
Returns the noise value interpolated between the smoothed noise at successive points in the distribution.
|
|
|
Get a weighted sum of adjacent random numbers to smooth the distribution.
|
|
||||||||||||||||
|
Linear interpolation.
|
|
|
A simple pseudo-random number regenator.
|
|
||||||||||||||||||||||||
|
Generate a list of noise values. This is a convenience method to pregenerate a discrete perlin noise field. Both perioidic and aperiodic fields can be created (the former have the same value at the start and at the end). The noise field can be scaled in X and Y (e.g. time and amplitude), as well as offset so that the mean value is non-zero.
|
|
|
Get the noise vaule at a particular position.
|
|
|
Randomize the offset. Subsequent noise will generally be uncorrelated to previously generated noise. Be aware that the random offset is in the range 10^9, so for large noise sets this property will break down. |
|
|
Set the interpolation method.
|
|
|
Set the offset into the noise functions. The offset can be used to reproducibly generate a given noise distribution, or to create independent finite noise distributions from the same generator. |
|
||||||||||||
|
Set the noise parameters.
|
|
SimData version pre-0.4.0. For more information on SimData, visit the SimData Homepage. Generated on Tue Oct 14 12:06:42 2003, using Doxygen 1.2.18. |