connect the dots

Nikolaus Gradwohl2015-06-12T08:19:41+00:00

I created a new sketch in processing that renders some random moving dots and connects them when they are within a certain radius. Click on the image to run the sketch in your browser

connect the dots

Tweet This! submit to reddit Digg! Tags: | 2 comments | no trackbacks

See also:

sketch experiment 7 - osc events
nested cubes in processing
processing phaseflower
Time Perception
de jong attractor

Trackbacks

Comments

Leave a response

  1. david caneso 2015-10-19T16:10:22+00:00

    the source in the connect the dots file is broken, I am looking to create something like this for a home screen in an app, and was wondering if you could send me the source or fix the broken source in the post. thanks.

    Great work

  2. Nikolaus Gradwohl 2015-10-21T06:32:15+00:00

    hmmm I think my source preview is confused by some of the brackets - anyways here is the sourcecode

    PVector[] dots; int LIMIT = 30; void setup() { noiseSeed( int(random(100))); size(300, 300); smooth(); dots = new PVector[300];

    for ( int i =0; i<dots.length; i++) { dots[i] = new PVector( random( width/2 ) +width/4, random( height/2 )+height/4); } }

    void draw() { background(255); for ( int i =0; i<dots.length; i++) {

    stroke(10, 100);
    
    for ( int j =0; j<i; j++) {
      float d = dots[i].dist(dots[j]);
      if ( i != j && d < LIMIT ) {
        strokeWeight( 1 - d/LIMIT );
        line( dots[i].x, dots[i].y, dots[j].x, dots[j].y );
      }
    }
    stroke(0);
    strokeWeight(1);
    fill(255);
    ellipse( dots[i].x, dots[i].y, 4, 4);
    
    dots[i].x += (noise(dots[i].y)-0.5)/1.0;
    dots[i].y += (noise(dots[i].x)-0.5)/1.0;
    

    } }

Leave a comment