Hi @Blomer478,
Welcome to the forum!
Few things on your code first :
-
Usually it’s a convention to put the
size(1000, 900)
function at the top of thesetup()
function so it’s the first instruction -
In the first for loop where you load images, you don’t need to say :
if (i > 35) { i = 1; }
because in the for loop,
i
goes from 0 to 33 (at 34 the condition isfalse
so it stops) and therefore the code in theif
block is never executed. -
Specifying
frameRate(30)
in thedraw()
loop is not optimal because you can just call it once in the setup function and it will be set for the whole sketch. Also unless you specifically want to restrict the framerate, you can just remove it and it will be around 60fps depending on your sketch and computer.
To answer your question, I think that the issue is that when using the scale()
function with a negative value, it’s mirroring the whole coordinate system from the top left corner :
So your images end up on the left side of the visible screen and therefore are not visible.
To make it work you need to use the translate()
function in order to translate the whole coordinate system to the location of your image then you can call the scale()
function to invert it. The last thing to consider is that the image()
function display the image from the top left corner and you might want to use imageMode(CENTER)
in order to draw them from their center :
You can check the tutorial on the coordinate system in Processing on the website :