Loop draw with rotating image

Hello guys,

I am new to processing… but im having a lot of fun learning new ways of programming. In this particular code i have a png which rotates in a 90 degrees angle. what im missing is that the png starts in the top left corner and then symmetrically loop the draw to fill the whole canvas from left to right with the png. as if it writes something from top left to bottom right corner.
I dont know if ive explained everything but feel free to ask.
Thank you for the help!

kind regards,
aerob

PImage pim;
float rot=0;
int y=0;
int x=0;

void setup(){
    size (3840,1080);
    frameRate(1);
  
  pim = loadImage("img.png");
}

void draw(){
 
  background(255);
  translate(x+75, y+50);
  rotate(rot);
  image(pim,-pim.width/2,-pim.height/2);

 rot+=PI/2;    

}   

yeah, you can just add something to x:

x++;

so the image should move right.

Now, when x reaches width, you want to start a new line (like when you read).

This means, set x to 0 and increase y, right?

Hey, and welcome to the forum!

Chrisir :wink: