#include <perlin.h>
Perlin Noise generation class. Class contains functions to generate 1D, 2D and 3D perlin noise.
Public Member Functions | |
PerlinNoise () | |
~PerlinNoise () | |
void | NewPrimeNumbers () |
bool | IsPrime (unsigned int uiA) |
unsigned int | RandomPrime () |
float | Noise (int iX) |
float | Noise (int iX, int iY) |
float | Noise (int iX, int iY, int iZ) |
float | Interpolate (float fA, float fB, float fX) |
float | SmoothNoise (int iX) |
float | SmoothNoise (int iX, int iY) |
float | SmoothNoise (int iX, int iY, int iZ) |
float | InterpolateNoise (float fX) |
float | InterpolateNoise (float fX, float fY) |
float | InterpolateNoise (float fX, float fY, float fZ) |
float | PerlinNoise1d (float fX, float fAmplitude, float fXfrequency) |
float | PerlinNoise2d (float fX, float fY, float fAmplitude, float fXFrequency, float fYFrequency) |
float | PerlinNoise3d (float fX, float fY, float fZ, float fAmplitude, float fXfrequency, float fYfrequency, float fZfrequency) |
void | GenerateLookup (unsigned int uiMaxX) |
void | GenerateLookup (unsigned int uiMaxX, unsigned int uiMaxY) |
void | GenerateLookup (unsigned int uiMaxX, unsigned int uiMaxY, unsigned int uiMaxZ) |
Protected Attributes | |
unsigned int | m_uiPrimeOne |
unsigned int | m_uiPrimeTwo |
unsigned int | m_uiPrimeThree |
float * | m_afLookUp |
unsigned int | m_uiMaxX |
unsigned int | m_uiMaxY |
unsigned int | m_uiMaxZ |
|
Set standard prime numbers |
|
Free Lookup table |
|
Sets new (random) prime numbers |
|
Function checks if the given value is a prime number.
|
|
Prime number generator. Prime numbers are used by the pseudo-random number generator. If you use different primes each time you generate a texture, you'll get unique textures. Which comes in handy if you want to create natural-looking textures.
|
|
1d Pseude-random number generator. Generates a pseudo-random number based upon one value(dimension).
|
|
2d Pseudo-random number generator. Generates a pseudo-random number based upon two values(dimensions).
|
|
3d Pseudo-random number generator. Generates a pseudo-random number based upon three values(dimensions).
|
|
Standard cosine interpolate function. Interpolates between two points. It interpolates between two points, using the third input.
|
|
1d Smooth function. Function takes the average of the neighbours to make the noise look less sharp.
|
|
2d Smooth function. Function takes the average of the neigbours (sides,corners,center) to make it look less sharp.
|
|
3d Smooth function. Functions takes the average of the neighbours to make it look less sharp.
|
|
1d Interpolate function. Function interpolates between the smoothed noise values.
|
|
2d Interpolate function. Function interpolates between the smoothed 2d noise values.
|
|
3d Interpolate function. Function interpolates between the smoothed 3d noise values.
|
|
1d Perlin Noise function. Generates perlin noise, using the given amplitude and frequency.
|
|
2d Perlin Noise function. Generates perlin noise, using the given amplitude and frequency.
|
|
3d Perlin Noise function. Generates perlin noise, using the given amplitude and frequency.
|
|
Generates the 1d noise and stores it in the lookup table (for faster processing).
|
|
Generates the 2d noise and stores it in the lookup table (for faster processing).
|
|
Generates the 3d noise and stores it in the lookup table (for faster processing).
|
|
Prime number one |
|
Prime number two |
|
Prime number three |
|
Lookup table |
|
Maximum x value (for lookup table) |
|
Maximum y value (for lookup table) |
|
Maximum z value (for lookup table) |