Created
September 16, 2020 12:18
-
-
Save pawal/a84edb64367dc5bbfc67999d8d74e9d8 to your computer and use it in GitHub Desktop.
flickering stuff for processing
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
// flickers and stuff | |
// by Patrik Wallström in processing | |
// pawal@amplitut.de 2020-09-16 | |
// user settings | |
int growthRate = 64; // the higher the faster number of divides | |
int scanLines = 64; // number of lines per division | |
// random globals | |
int x1=1; | |
int xdivide = 1; | |
void setup() { | |
frameRate(60); | |
fullScreen(P2D,0); | |
background(0); | |
noStroke(); | |
fill(102); | |
} | |
void draw() { | |
background(0); | |
int ydivide = width / (xdivide + 1); | |
for (int j = 0; j < xdivide+1; j++) { | |
int ystart = ydivide * j; | |
int yend = ystart + ydivide; | |
for (int i = 0; i < scanLines; i++) { | |
int row = (int) random(0,height); | |
stroke((int) random(0,255)); // change to x later..? | |
line (ystart, row, yend, row); | |
} | |
x1 = (int) (frameCount / 100) + 1; | |
xdivide = (int) frameCount / growthRate; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment