-
-
Save giruzou/b883f35a362594c3ed4d7c1126d26cb6 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
int num = 50; | |
PVector[] points = new PVector[num]; | |
void setup() { | |
size(320, 240); | |
colorMode(HSB, 360, 100, 100, 100); | |
noStroke(); | |
for (int i = 0; i < points.length; i++) { | |
float x = random(width); | |
float y = random(height); | |
points[i] = new PVector(x, y); | |
} | |
} | |
void draw() { | |
randomSeed(100); | |
background(0, 0, 0); | |
for (PVector p : points) { | |
float d = random(5, 35); | |
float n = noise(p.x/5f, p.y/5f, frameCount/10f); | |
float hue = map(n, 0, 1, 0, 60); | |
fill(hue, 80, 100, 60); | |
ellipse(p.x, p.y, d, d); | |
p.x -= 1; | |
if (p.x < 0) p.x += width; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment