Gin
Loading...
Searching...
No Matches
Public Member Functions | List of all members
PerlinNoise< T > Class Template Reference

Generates Perlin noise - a type of gradient noise with natural-looking characteristics. More...

#include <gin_util.h>

Public Member Functions

 PerlinNoise ()
 Creates a PerlinNoise generator with the default permutation table.
 
 PerlinNoise (unsigned int seed)
 Creates a PerlinNoise generator with a randomized permutation table.
 
noise (T x, T y=0, T z=0)
 Generates a Perlin noise value at the specified coordinates.
 

Detailed Description

template<class T>
class PerlinNoise< T >

Generates Perlin noise - a type of gradient noise with natural-looking characteristics.

Perlin noise is widely used in procedural generation for creating textures, terrain, and other organic-looking random variations. It produces smooth, coherent noise with controllable frequency and amplitude.

Based on the reference implementation by Ken Perlin. See: http://mrl.nyu.edu/~perlin/paper445.pdf

See also
noise

Constructor & Destructor Documentation

◆ PerlinNoise() [1/2]

template<class T >
PerlinNoise< T >::PerlinNoise ( )

Creates a PerlinNoise generator with the default permutation table.

◆ PerlinNoise() [2/2]

template<class T >
PerlinNoise< T >::PerlinNoise ( unsigned int  seed)

Creates a PerlinNoise generator with a randomized permutation table.

Parameters
seedThe random seed used to generate the permutation table

References shuffleArray().

Member Function Documentation

◆ noise()

template<class T >
T PerlinNoise< T >::noise ( x,
y = 0,
z = 0 
)

Generates a Perlin noise value at the specified coordinates.

Parameters
xThe x coordinate
yThe y coordinate (defaults to 0 for 1D or 2D noise)
zThe z coordinate (defaults to 0 for 1D or 2D noise)
Returns
A noise value in the range [0, 1]

The documentation for this class was generated from the following file: