I’m extremely new to this and have made a design using a tutorial. My code runs smoothly until I enter: saveFrame(“output/frames_####.png”);
when I enter this, my video does not run, instead there is a blank screen. please help if you can
CODE BELOW:
float[] values;
int i = 0;
int j = 0;
void setup() {
size(600, 600);
values = new float[width];
for (int i = 0; i < values.length; i++) {
values[i] = random(height);
}
//for (int i = 0; i < values.length; i++) {
// for (int j = 0; j < values.length-i-1; j++) {
// }
//}
}
void draw() {
background(0);
if (i < values.length) {
for (int j = 0; j < values.length-i-1; j++) {
float a = values[j];
float b = values[j+1];
if (a > b) {
swap(values, j, j+1);
}
}
} else {
println("finished");
noLoop();
}
i++;
for (int i = 0; i < values.length; i++) {
stroke(255);
line(i, height, i, height - values[i]);
}
}
void swap(float[] arr, int a, int b) {
float temp = arr[a];
arr[a] = arr[b];
arr[b] = temp;
saveFrame("output/frames_####.png");
}