Skip to content

Instantly share code, notes, and snippets.

@0b5vr
Created September 1, 2014 19:26
Show Gist options
  • Save 0b5vr/d4a52a00b20f50ec14f4 to your computer and use it in GitHub Desktop.
Save 0b5vr/d4a52a00b20f50ec14f4 to your computer and use it in GitHub Desktop.
Processing: Motion blur test
void setup()
{
size(240,240);
}
void draw()
{
background(0);
for(int blur=0;blur<10;blur++)
{
float t=frameCount+blur*.2;
for(int c=0;c<=80;c++)
{
float x=160-c*.9+sin(t*PI*.04+c*.4)*sin(c*PI/80)*(80+c*.3);
float y=140-c*.45+cos(t*PI*.04+c*.4)*sin(c*PI/80)*(80+c*.3);
float r=127+127*sin(c*PI/40);
float g=127+127*sin(c*PI/40+PI/3*2);
float b=127+127*sin(c*PI/40+PI/3*4);
fill(r,g,b,sin(blur*PI/10)*190);
noStroke();
ellipse(x,y,2+c*.02,2+c*.02);
}
}
// saveFrame("./capture/###.png");
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment