from Bill Van Loo:

This is the first version of a Processing sketch I've been working on called (unsurprisingly) "many circles". I still have some stuff to work out; namely, how to get the lines to draw only to the edge of the circles instead of to the midpoint.

My wife and I worked out some of the math, but it makes my head hurt, so I haven't tried to implement it yet.

Credits

1 Like

  • Daniel Giles Helm 1 year ago
    Nice and simple. I'm just starting with processing, but curious with the problem I just filled a page in my notebook with what I think is the answer, I might try to make a function out of it later and I can send it your way.

    My question for you: how did you get the fading look later in the video? And the changing to single colors so late in the sketch? Was this done post-processing or using several versions or did you just count the frames for the entirety?
  • Daniel Giles Helm 1 year ago
    Sorry, I became a little obsessed with the question. This is the code I came up with. It isn't marked up real well and if you're curious how I came up with any numbers, let me know.

    void setup(){
    size(800,600);
    background(0);
    frameRate(10);
    }

    void draw(){
    smooth();
    circle(random(-width/2,width/2),random(-height/2,height/2),random(20,60));
    }

    void circle(float x, float y, float size){
    pushMatrix();
    translate(width/2,height/2);
    scale(1,-1);
    fill(random(0,255),random(0,255),random(0,255),130);
    strokeWeight(1);
    stroke(255,160);
    ellipse(x,y,size,size);
    stem(x,y,size);
    popMatrix();
    }

    void stem(float x, float y, float size){
    float radius = size/2;
    float dist = sqrt(sq(x)+sq(y));
    if (x == 0) {
    line(0,0,0,y-radius);
    }
    else {
    float distNew = dist - radius;
    float slope = y/x;
    float x2 = sqrt(sq(distNew)/(sq(slope)+1));
    float y2 = slope*x2;
    if (x < 0) {
    x2 = -x2;
    y2 = -y2;
    }
    line(0,0,x2,y2);
    }
    }
  •  
This conversation is missing your voice. Take five seconds to join Vimeo or log in.

Advertisement

3 Related collections

Statistics

  •  
    plays
    likes
    comments
  • Total
    plays 337
    likes 1
    comments 2
  • Dec 16th
    plays 0
    likes 0
    comments 0
  • Dec 15th
    plays 0
    likes 0
    comments 0
  • Dec 14th
    plays 0
    likes 0
    comments 0
  • Dec 13th
    plays 0
    likes 0
    comments 0
  • Dec 12th
    plays 0
    likes 0
    comments 0
  • Dec 11th
    plays 0
    likes 0
    comments 0
  • Dec 10th
    plays 1
    likes 0
    comments 0
  • Dec 9th
    plays 0
    likes 0
    comments 0
Previous Week

Downloads

Please join Vimeo or log in to download the original file. It only takes a few seconds.