• Random Drawing •

Download standalone version:

  • Mac
  • Linux
  • Windows
  • Random Drawing - Processing
    Random Drawing - Processing
    Random Drawing - Processing
    Random Drawing - Processing
    Random Drawing - Processing
    Random Drawing - Processing

    float theta = 0.05f;

    void setup()
    {
    size(300,300,P3D);
    ellipseMode(CENTER);
    sphereDetail(90);
    frameRate(70);
    }

    void draw()
    {
    float r = theta + random(150);
    background(0);
    theta += 0.05f;
    float z = r + sin(theta)*20.0f ;
    float t = tan(z)*20.0f;
    fill(r+z,r,r+t);

    for (int i=0;i<600;i=i+1)
    {
    translate(i,r,z);
    rotateY(t+5);
    translate(i+10+r,i+5,z);
    rotateX(theta+i);
    stroke(200);
    fill(i+z*r,r-i,r+t-i);
    sphere(r+t-i);
    translate(i,r*i,z);
    rotateY(t+z-i);
    translate(i+10+r,i+5,0);
    rotateX(theta+i);
    stroke(200);
    fill(i,i,r);
    ellipse(r-t-i,i,i-t,r);
    sphere(r-t-i);
    stroke(r-1+t);
    curveTightness(t+r-i);
    beginShape();
    fill(i,t,r);
    curveVertex(r+1, r);
    curveVertex(z+t, i);
    curveVertex(t+i-z, r);
    curveVertex(z-i, r+i-z);
    fill(r,i,r);
    curveVertex(r+1, r);
    curveVertex(z+t, i);
    curveVertex(t+i-z, r);
    curveVertex(z-i, r+i-z);
    endShape();
    }
    //saveFrame();
    }