Here is my code down below, when in run it shows multiple boxes as I wanted but when I try to export, it only shows a single box at that frame position.I tried generating output at particular frame but its same issue
import processing.pdf.*;
int ofs = 500;
boolean record;
void setup() {
size(1900, 1080, P3D);
}
void draw() {
if (record) {
beginRaw(PDF, "box.pdf");
}
background(255);
translate(width/2, height/2, -800);
rotateZ(0.3);
rotateY(frameCount/500.0);
float x = sin(radians(frameCount*0.1));
for ( int xo = -ofs; xo<=ofs; xo += 100) {
for ( int yo = -ofs; yo<=ofs; yo += 100) {
pushMatrix();
translate ( xo, yo, 0);
box(200*x);
fill(155,150,90);
strokeWeight(3*x);
popMatrix();
if (record) {
endRaw();
record = false;
}
}
}
}
void keyPressed() {
if (key == 'r') {
record = true;
}
}