Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- float x, y, t, theta;
- int points = 50, num = 56, num2= 28, frms = 10;
- void setup() {
- size(900, 900, P2D);
- smooth(8);
- //colorMode(HSB,360,100,100);
- noStroke();
- //noFill();
- }
- void draw() {
- background(0);
- for (int j = 0; j< num; j++) {
- float offSet = TWO_PI/num*j;
- pushMatrix();
- translate(width/2, height/2);
- scale(map(cos(theta), -1, 1, .5, 4));
- rotate(PI+offSet+theta);
- pushMatrix();
- translate(0, -180);
- //rotate(theta*5);
- //rotate(offSet*3+theta*5);
- fill(255);
- float sz = map(sin(theta+offSet*3), -1, 1, 30, 60);
- beginShape();
- for (int i=0; i<points; i++) {
- t = TWO_PI/points*i;
- x = (sin(t) < 0) ? sin(t) * sz : -sin(t) * sz*.8;
- y = cos(t) * sz;
- vertex(x, y);
- }
- endShape(CLOSE);
- popMatrix();
- popMatrix();
- }
- for (int j = 0; j< num2; j++) {
- float offSet = TWO_PI/num2*j;
- pushMatrix();
- translate(width/2, height/2);
- scale(map(sin(theta*2), -1, 1, .25, 2.5));
- rotate(PI+offSet-theta);
- pushMatrix();
- translate(0, -70);
- //rotate(theta*5);
- //rotate(offSet*3+theta*5);
- fill(255);
- beginShape();
- for (int i=0; i<points; i++) {
- t = TWO_PI/points*i;
- x = (sin(t) < 0) ? sin(t) * 30 : -sin(t) * 25;
- y = cos(t) * 30;
- vertex(x, y);
- }
- endShape(CLOSE);
- popMatrix();
- popMatrix();
- }
- theta += TWO_PI/num2/frms;
- if (theta<TWO_PI) saveFrame("image-###.tga");
- //if (frameCount<=frms*5) saveFrame("image-###.tga");
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement