Package net.paulhertz.pixelaudio
Class ScaledSimplex
java.lang.Object
net.paulhertz.pixelaudio.ScaledSimplex
A wrapper for OpenSimplex2, adapted from Christian Maher's code at
https://cmaher.github.io/posts/working-with-simplex-noise/
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionScaledSimplex(int seed) ScaledSimplex(int octaves, float detail) ScaledSimplex(int octaves, float detail, float inc) ScaledSimplex(int octaves, float detail, float inc, int seed) ScaledSimplex(int octaves, float detail, int seed) -
Method Summary
Modifier and TypeMethodDescriptionfloatfloatgetInc()floatgetNoiz()intintgetSeed()floatnoise1(float x) floatnoise2(float x, float y) floatnoise2(float x, float y, float low, float high) floatnoise2(int iter, float x, float y, float det, float scale, float low, float high) floatnoise3(float x, float y, float z) floatnoise3(float x, float y, float z, float low, float high) floatnoise3(int iter, float x, float y, float z, float det, float scale, float low, float high) voidsetDetail(float detail) voidsetInc(float inc) voidsetNoiz(float noiz) voidsetOctaves(int octaves) voidsetSeed(int newSeed)
-
Field Details
-
generator
-
octaves
int octaves -
detail
float detail -
inc
float inc -
noiz
float noiz -
seed
int seed
-
-
Constructor Details
-
ScaledSimplex
public ScaledSimplex() -
ScaledSimplex
public ScaledSimplex(int seed) -
ScaledSimplex
public ScaledSimplex(int octaves, float detail) -
ScaledSimplex
public ScaledSimplex(int octaves, float detail, int seed) -
ScaledSimplex
public ScaledSimplex(int octaves, float detail, float inc) -
ScaledSimplex
public ScaledSimplex(int octaves, float detail, float inc, int seed)
-
-
Method Details
-
getSeed
public int getSeed() -
setSeed
public void setSeed(int newSeed) -
getOctaves
public int getOctaves() -
setOctaves
public void setOctaves(int octaves) -
getDetail
public float getDetail() -
setDetail
public void setDetail(float detail) -
getInc
public float getInc() -
setInc
public void setInc(float inc) -
getNoiz
public float getNoiz() -
setNoiz
public void setNoiz(float noiz) -
noise2
public float noise2(int iter, float x, float y, float det, float scale, float low, float high) - Parameters:
iter- number of iterations of scaled noise (same as "octaves")x- x-coordinatey- y-coordinatedet- amount of detail retained from each scaled iteration, aka "persistence"scale- the effective distance between coordinate points, referred to as "inc" in our codelow- lower bound, typically for a pixel valuehigh- upper bound, typically for a pixel value- Returns:
- the noise value at (x, y, z), the value of "noiz"
-
noise1
public float noise1(float x) -
noise2
public float noise2(float x, float y) -
noise2
public float noise2(float x, float y, float low, float high) -
noise3
public float noise3(int iter, float x, float y, float z, float det, float scale, float low, float high) - Parameters:
iter- number of iterations of scaled noise (same as "octaves")x- x-coordinatey- y-coordinatez- z-coordinate, incrementing z drives the animation over a 2D bitmap in x and ydet- amount of detail retained from each scaled iteration, aka "persistence"scale- the effective distance between coordinate points, referred to as "inc" in our codelow- lower bound, typically for a pixel valuehigh- upper bound, typically for a pixel value- Returns:
- the noise value at (x, y, z), the value of "noiz"
-
noise3
public float noise3(float x, float y, float z) -
noise3
public float noise3(float x, float y, float z, float low, float high)
-