Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- color bg = #E2D9D0;
- color str = #558587;
- int num = 40;
- Bow[] bows = new Bow[num];
- void setup() {
- size(500, 500);
- background(bg);
- noFill();
- stroke(str,150);
- strokeWeight(2);
- float theta = PI/2;
- float y = 90;
- for (int i=0; i<num; i++) {
- bows[i]= new Bow( y, theta);
- theta += TAU/num;
- y += (height-120)/num;
- }
- }
- void draw() {
- background(bg);
- for (int i=0; i<bows.length; i++) {
- bows[i].display();
- }
- if (frameCount % 3 == 0 && frameCount<121) saveFrame("image-####.gif");
- }
- class Bow {
- float diam, diam_x, theta, y, sw;
- Bow(float _y, float _theta) {
- y = _y;
- theta = _theta;
- }
- void display() {
- diam = map(cos(theta), -1, 1, 20, 150);
- diam_x = map(cos(theta), -1, 1, 100, 250);
- sw = map(cos(theta), -1, 1, 1, 10);
- strokeWeight(sw);
- //line(0, y, 150, y);
- arc(width/2, y, diam_x, diam, PI, TAU);
- //line(350, y, 500, y);
- theta += 0.0523;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement