Skip welcome & menu and move to editor
Welcome to JS Bin
Load cached copy from
 
<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width">
  <title>JS Bin</title>
</head>
<body>
<script src="https://cdnjs.cloudflare.com/ajax/libs/processing.js/1.4.1/processing-api.min.js"></script>
</body>
</html>
 
// All Examples Written by Casey Reas and Ben Fry
// unless otherwise stated.
PVector[] p = new PVector[3];
float shift = 1.0;
float fade = 0;
float fillCol = 0;
float rot = 0;
float spin = 0;
void setup() {
  size(200, 200);
  background(0);
  smooth();
  fade = 255.0 / (width/2.0/shift);
  spin = 360.0 / (width/2.0/shift);
  p[0] = new PVector(-width/2, height/2);
  p[1] = new PVector(width/2, height/2);
  p[2] = new PVector(0, -height/2);
  noStroke();
  translate(width/2, height/2);
  triBlur();
}
void triBlur() {
  fill(fillCol);
  fillCol += fade;
  rotate(spin);
  // another interesting variation: uncomment the line below 
  // rotate(rot+=radians(spin));
  triangle(p[0].x += shift, p[0].y -= shift/2, 
           p[1].x -= shift, p[1].y -= shift/2, 
           p[2].x, p[2].y += shift); 
  if (p[0].x < 0) {
    // recursive call
    triBlur();
  }
}
Output

You can jump to the latest bin by adding /latest to your URL

Dismiss x
public
Bin info
anonymouspro
0viewers