Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- int num = 7;
- int rad = 30;
- float[] x = new float[num];
- float[] y = new float[num];
- float[] offSet = new float[num];
- float theta, angle;
- void setup() {
- size(500, 500);
- for (int i=0; i<num; i++) {
- int radius = (int) random(100,200);
- x[i] = sin(theta)*radius ;
- y[i] = cos(theta)*radius ;
- offSet[i] = random(TWO_PI);
- theta += (TWO_PI/num);
- }
- }
- void draw() {
- background(255);
- translate(width/2, height/2);
- beginShape();
- for (int i=0; i<num; i++) {
- fill(#074358);
- float px = sin(angle+offSet[i])*rad*1.5;
- float py = cos(angle+offSet[i])*rad*1.5;
- vertex(x[i]+px, y[i]+py);
- }
- endShape(CLOSE);
- beginShape();
- for (int i=0; i<num; i++) {
- fill(255);
- noStroke();
- float px = sin(angle+offSet[i])*rad;
- float py = cos(angle+offSet[i])*rad;
- vertex(x[i]+px, y[i]+py);
- }
- endShape(CLOSE);
- beginShape();
- for (int i=0; i<num; i++) {
- fill(#074358);
- noStroke();
- float px = sin(angle+offSet[i])*rad*.75;
- float py = cos(angle+offSet[i])*rad*.75;
- vertex(x[i]+px, y[i]+py);
- }
- endShape(CLOSE);
- beginShape();
- for (int i=0; i<num; i++) {
- fill(255);
- noStroke();
- float px = sin(angle+offSet[i])*rad*.5;
- float py = cos(angle+offSet[i])*rad*.5;
- vertex(x[i]+px, y[i]+py);
- }
- endShape(CLOSE);
- angle += 0.0523;
- if (frameCount%4==0 && frameCount<121) saveFrame("image-###.gif");
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement