VOX
A little voxel engine
Loading...
Searching...
No Matches
Perlin Class Reference

Perlin noise generator. More...

#include <Perlin.hpp>

Collaboration diagram for Perlin:
Collaboration graph

Public Member Functions

 Perlin (unsigned int seed)
 Construct a new Perlin object. More...
 
 Perlin (unsigned int seed, int octaves, float frequency, float persistence, float lacunarity)
 Construct a new Perlin object. More...
 
float noise (const float &x) const
 generate 1D Perlin noise in the range [-1, 1] More...
 
float noise (const glm::vec2 &v) const
 generate 2D Perlin noise in the range [-1, 1] More...
 
float noise (const glm::vec3 &v) const
 generate 3D Perlin noise in the range [-1, 1] More...
 

Detailed Description

Perlin noise generator.

This class is a Perlin noise generator. It can generate 1D, 2D and 3D Perlin noise. It will return a value in the range [-1, 1].

Note
To understand how to tune the noise generation, i highly recommend to read this, http://campi3d.com/External/MariExtensionPack/userGuide5R8/Understandingsomebasicnoiseterms.html and to understand the noise generation, i recommend to read this, https://eev.ee/blog/2016/05/29/perlin-noise/

Constructor & Destructor Documentation

◆ Perlin() [1/2]

Perlin::Perlin ( unsigned int  seed)

Construct a new Perlin object.

Parameters
seedThe seed to use to generate the noise, the same params with the same seed will always return the same value

◆ Perlin() [2/2]

Perlin::Perlin ( unsigned int  seed,
int  octaves,
float  frequency,
float  persistence,
float  lacunarity 
)

Construct a new Perlin object.

This constructor allows to tune the noise generation, it is highly recommended to read this, http://campi3d.com/External/MariExtensionPack/userGuide5R8/Understandingsomebasicnoiseterms.html

Parameters
seedSame as default constructor
octavesDefault is 1
frequencyDefault is 1
persistenceDefault is 0.5
lacunarityDefault is 2.0

Member Function Documentation

◆ noise() [1/3]

float Perlin::noise ( const float &  x) const

generate 1D Perlin noise in the range [-1, 1]

Parameters
xa point in the 1D space
Returns
a value in the range [-1, 1]

◆ noise() [2/3]

float Perlin::noise ( const glm::vec2 &  v) const

generate 2D Perlin noise in the range [-1, 1]

Parameters
va point in the 2D space
Returns
a value in the range [-1, 1]

◆ noise() [3/3]

float Perlin::noise ( const glm::vec3 &  v) const

generate 3D Perlin noise in the range [-1, 1]

Parameters
va point in the 3D space
Returns
a value in the range [-1, 1]

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