Skip to content

Instantly share code, notes, and snippets.

@Ludonaut
Created March 7, 2014 23:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Ludonaut/9422278 to your computer and use it in GitHub Desktop.
Save Ludonaut/9422278 to your computer and use it in GitHub Desktop.
// 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);
}
}
@Ludonaut
Copy link
Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment