Chasing balls with faiding tails

Rotor Another very simple Processing script. Nothing fancy just three points with circle orbits and blur on every step to ensure the fading of the “tails” but still looks nice.

int R = 20;  //radius
int speed = 2;  // speed

int t = 0;
float x;
float y;
int offx = 0;
int offy = 0;

void setup(){
  size(80,80);
  offx = width/2;
  offy = height/2;
  background(0);
  strokeWeight(7);
}

void draw(){
  filter(BLUR,1);
  stroke(#FF0000);
  x = sin(radians(t))*R+offx;
  y = cos(radians(t))*R+offy;
  point (x,y);
  stroke(#00FF00);
  x = sin(radians(t+120))*R+offx;
  y = cos(radians(t+120))*R+offy;
  point (x,y);
  stroke(#0000FF);
  x = sin(radians(t+240))*R+offx;
  y = cos(radians(t+240))*R+offy;
  point (x,y);
  t += speed;
}

Comments

comments powered by Disqus