Created
September 17, 2013 10:11
-
-
Save dimkir/6592450 to your computer and use it in GitHub Desktop.
Created using Sketch2Tweet tool
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
int i, n, s=900; | |
void setup() { | |
size(s, s); | |
colorMode(HSB, 255); | |
} | |
void draw() { | |
n=int(90+90*sin((i+=5)*.51)); | |
// a bit faster ^^^^ | |
textSize(n); | |
fill(233<<n); | |
int x = i%s-50; | |
int y = 99*(i/s)%s-n; | |
lineTo(x,y); // replaced with random colored lines. | |
//text(i/s,x , y); | |
}//#p5 | |
int prevX = -100; | |
int prevY = -100; | |
void lineTo(int x, int y ){ | |
stroke(randomColor()); | |
strokeWeight(random(2,15)); | |
if ( prevX == -100 ){ | |
// this is first run, just set vars | |
point(x,y); | |
prevX = x; prevY = y; | |
} | |
else{ | |
line(prevX, prevY, x, y); | |
prevX = x; prevY = y; | |
} | |
} | |
color randomColor(){ | |
return color((int)random(255), 200,200); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This is comment which can show image of the sketch