class Noise::Perlin

Defined in:

noise/perlin.cr

Constant Summary

GRADIENTS = [[1, 1, 0], [-1, 1, 0], [1, -1, 0], [-1, -1, 0], [1, 0, 1], [-1, 0, 1], [1, 0, -1], [-1, 0, -1], [0, 1, 1], [0, -1, 1], [0, 1, -1], [0, -1, -1]]

The gradients are the midpoints of the vertices of a cube.

SKEW_FACTOR = 0.5 * ((Math.sqrt(3.0)) - 1.0)

Skew the input space to determine which simplex cell we're in

UNSKEW_FACTOR = (3.0 - (Math.sqrt(3.0))) / 6.0

Constructors

Instance Method Summary

Constructor Detail

def self.new(seed : Int) #

[View source]
def self.new #

[View source]

Instance Method Detail

def fractal(octaves : Int, persistence : Float, scale : Float, x : Float, y : Float) : Float #

[View source]
def noise(x : Float, y : Float) : Float #

[View source]
def scaled_noise(loBound : Float, hiBound : Float, x : Float, y : Float) : Float #

[View source]
def scaled_octave_noise(octaves : Float, persistence : Float, scale : Float, loBound : Float, hiBound : Float, x : Float, y : Float) : Float #

[View source]