Perlin Noise Terrain Generator
A Program to Generate Terrain from Perlin Noise with Exponentially Distributed Gradient Magnitude
 All Files Functions Variables Macros Pages
Functions
perlin.h File Reference

Header file for 2D Perlin noise with exponentially distributed gradients. More...

Go to the source code of this file.

Functions

void initPerlin2D ()
 Initialize gradient and permutation tables.
 
float PerlinNoise2D (const float, const float, const int)
 Generate a cell of 2D Perlin noise.
 

Function Documentation

void initPerlin2D ( )

Initialize gradient and permutation tables.

Initialize the permutation, gradient, and magnitude tables.

float PerlinNoise2D ( const float  x,
const float  y,
const int  n 
)

Generate a cell of 2D Perlin noise.

Turbulence is also known as 1/f noise.

Parameters
xX coordinate.
yY coordinate.
nNumber of octaves.
Returns
Noise value in the range -1 to 1.