My Video

This was a fun tutorial. You can see the animation I created from the code below along with Alexander’s tutorial and my version of the code below.

 

Alexander’s Processing Tutorial

 

 

My Code


// y = 5x

// x = 5t
// y = 3t +3

static final int NUM_LINES = 200;

float t;

void setup() {
background(20);
size(1920, 1080);
}

void draw() {
background(20);
stroke(255);
strokeWeight(1);

translate(width/2, height/2);
for (int i = 0; i < NUM_LINES; i++) {
line(x1(t + i), y1(t + i), x2(t + i), y2(t + i));
}
// point(x1(t), y1(t));
// point(x2(t), y2(t));
t++;

}

float x1(float t) {
return sin(t / 10) * 300 + sin(t / 15) * random(20,40);
}

float y1(float t) {
return cos(t / 10) * 200;
}

float x2(float t) {
return sin(t / 10) * 400 + sin(t) * 2;
}

float y2(float t) {
return cos(t / 20) * 450 + cos(t / 12) * random(30,50);
}