Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- int num=20, num2=8, frames=100;
- float angle, diam, x, y, theta;
- void setup() {
- size(500, 500);
- noStroke();
- colorMode(HSB, 360, 100, 100);
- }
- void draw() {
- randomSeed(23323);
- background(#202020);
- angle=0;
- translate(width/2, height/2);
- for (int j=0; j<num2; j++) {
- num =int(map(j, 0, num2-1, 20, 10));
- beginShape();
- for (int i=0; i<num; i++) {
- float br = map(j, 0, num2-1, 90, 20);
- fill(150, 80, br);
- float scal = map(j, 0, num2-1, .35, .05);
- float r = map(j, 0, num2-1, 15, 10);
- diam = width*scal+random(r);
- float v = map(sin(theta+random(TWO_PI)), -1, 1, 1, random(1, 1.2));
- x = sin(angle*i)*diam*v;
- y = cos(angle*i)*diam*v;
- if (i==0) curveVertex(x, y);
- curveVertex(x, y);
- if (i==num-1) curveVertex(x, y);
- angle = TWO_PI/num;
- }
- endShape(CLOSE);
- }
- theta += TWO_PI/frames;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement