Perlin¶
The Perlin noise module allows to create perlin noise values for x/y coordinates.
Usage¶
To use this class, add the following require at the top of your script:
local Perlin = require 'engine/math/perlin'
Reference¶
- Perlin.setSeed(newSeed)¶
Set perlin noise seed. Perlin noise is initially seeded with seed value 0
- Parameters:
newSeed (
number) – the new seed value for perlin noise.
- Perlin.noise(x, y)¶
Create a perlin noise value for x and y coordinates
- Parameters:
x (
number) – the X coordinate for the perlin noisey (
number) – the Y coordinate for the perlin noise
- Returns:
the perlin noise value
- Return type:
number