I have this code. It generates a random 2D Greyscale Image. Works fine.
size(1920,1080);
int cols = width;
int rows = height;
int[][] myArray = new int[cols][rows];
for (int i = 0; i < cols; i++) {
for (int j = 0; j < rows; j++) {
myArray[i][j] = int(random(255));
}
}
for (int i = 0; i < cols; i++) {
for (int j = 0; j < rows; j++) {
stroke(myArray[i][j]);
point(i,j);
}
}
Now the thing i couldnt get my head around for a very long time is how i can make it:
Compute and Show Image for X seconds then, Compute and Show (an other) Image for X seconds (loop).
After start or key pressed.
In Fullscreen.
Help would be very very much appreciated. I just cant do it.