Support Forum G3D Web Page |
3D fixed point Perlin noise generator.
More...
Public Member Functions | |
Noise () | |
Not threadsafe. More... | |
int | sample (int x, int y, int z) |
Returns numbers between -2^16 and 2^16. More... | |
float | sampleFloat (int x, int y, int z, int numOctaves=1) |
Returns numbers on the range [-1, 1] for a single octave of noise. More... | |
uint8 | sampleUint8 (int x, int y, int z) |
Returns numbers on the range [0, 255]. More... | |
Static Public Member Functions | |
static Noise & | common () |
3D fixed point Perlin noise generator.
Ported from Ken Perlin's Java INoise implementation.
Example:
|
inline |
Not threadsafe.
|
static |
|
inline |
Returns numbers between -2^16 and 2^16.
Arguments should be on the order of 2^16
Threadsafe.
Referenced by sampleUint8().
float G3D::Noise::sampleFloat | ( | int | x, |
int | y, | ||
int | z, | ||
int | numOctaves = 1 |
||
) |
Returns numbers on the range [-1, 1] for a single octave of noise.
Each octave adds 0.5 of the range of the previous one. An infinite number of octaves is bounded by [-2, 2].
Unique values occur at coordinates that are multiples of 2^16 for the lowest frequency octave. Between those the noise smoothly varies.
Threadsafe.
|
inline |
Returns numbers on the range [0, 255].
Arguments should be on the order of 2^16
Threadsafe.