This was a complete accident (I was going for an affect so wildly different, it's kind of ridiculous). I acctually completely forgot to add something before hitting play.
But yeah, kinda pretty. Thought I would share. Here's the source.

import traer.physics.*;
import java.util.*;

import processing.video.*;

MovieMaker mm;

ParticleSystem physics;
Particle[] part;
Particle mouse;
Spring[] spring;

void setup() {
size(640, 480);
background(#83bdc9);
smooth();
colorMode(HSB,255);

mm = new MovieMaker(this, width, height, "drawing2.mov", 24, MovieMaker.JPEG , MovieMaker.MEDIUM );

physics = new ParticleSystem( 0, 0 );

part = new Particle[width];
mouse = physics.makeParticle();
mouse.makeFixed();

part[0] = physics.makeParticle( 1.0, 0, height/2, 0);
for ( int i = 1; i < part.length-1; i++ )
{
part[i] = physics.makeParticle( 1.0, i+1, height/2, 0 );
physics.makeSpring( part[i], part[i-1], 0.7, 0.1, 100 );
physics.makeAttraction( part[i], mouse, 5000, 40 );
}
}


void draw() {
physics.tick( 1.0);
mouse.position().set( mouseX, mouseY, 0);
//background( 255 );

for ( int i = 1; i < part.length-1; i++ )
{
Particle p = part[i];
Particle g = part[i-1];
fill(255);
stroke(p.age(), g.age()%255, random(0,255));

line(p.position().x(),p.position().y(),g.position().x(),g.position().y());
}
mm.addFrame();
}

void mouseClicked(){
saveFrame("p" + month() + day() + hour() + minute() + second() + ".png");
}



void keyPressed() {
if (key == ' ') {
// Finish the movie if space bar is pressed
mm.finish();
// Quit running the sketch once the file is written
exit();
}
}
This conversation is missing your voice. Take five seconds to join Vimeo or log in.

Advertisement

Statistics

  •  
    plays
    likes
    comments
  • Total
    plays 25
    likes 0
    comments 0
  • Jan 1st
    plays 0
    likes 0
    comments 0
  • Dec 31st
    plays 0
    likes 0
    comments 0
  • Dec 30th
    plays 0
    likes 0
    comments 0
  • Dec 29th
    plays 0
    likes 0
    comments 0
  • Dec 28th
    plays 0
    likes 0
    comments 0
  • Dec 27th
    plays 0
    likes 0
    comments 0
  • Dec 26th
    plays 0
    likes 0
    comments 0
  • Dec 25th
    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.