Created
July 27, 2020 11:57
-
-
Save Nekodigi/8f5a1dea37d738130a637de91f56368c to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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