Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Nekodigi/8f5a1dea37d738130a637de91f56368c to your computer and use it in GitHub Desktop.
Save Nekodigi/8f5a1dea37d738130a637de91f56368c to your computer and use it in GitHub Desktop.
float noiseS = 500;//noise scale
float noiseP = 1;//noise power
int iter = 100;//move iteration
PVector p;//particle
void setup(){
size(500, 500);
p = new PVector(100, height/2);
ellipse(p.x, p.y, 10, 10);
for(int i=0; i<iter; i++){
float angle = noise(p.x/noiseS, p.y/noiseS)*TWO_PI*8;
p.add(PVector.fromAngle(angle).mult(noiseP));
ellipse(p.x, p.y, 10, 10);
}
ellipse(p.x, p.y, 10, 10);
for(int i=0; i<iter; i++){
float angle = noise(p.x/noiseS, p.y/noiseS)*TWO_PI*8;
p.add(PVector.fromAngle(angle).mult(-noiseP));
ellipse(p.x, p.y, 10, 10);
}
ellipse(p.x, p.y, 10, 10);
}
void draw(){
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment