Created
March 7, 2014 23:23
-
-
Save Ludonaut/9422278 to your computer and use it in GitHub Desktop.
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
// juuuust under 250 for a nicer canvas border. | |
int randomOffset = 249; | |
int transparency = 20; | |
void setup() { | |
size(500, 500); | |
background(0); | |
} | |
void draw() { | |
stroke(255, transparency); | |
for(int i=0; i < 30; i++) { | |
// create two random numbers to use as the line's starting point | |
float startX = random(randomOffset * -1, randomOffset); | |
float startY = random(randomOffset * -1, randomOffset); | |
// create two random numbers to use as the line's ending point | |
float endX = random(randomOffset * -1, randomOffset); | |
float endY = random(randomOffset * -1, randomOffset); | |
line(250 + startX, 250 + startY, 250 + endX, 250 + endY); | |
} | |
} |
Author
Ludonaut
commented
Apr 10, 2014
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment