I seek to generate an effect in which the squares get closer and give that feeling of being “entering” in those squares.
Sorry if I don’t express myself well, my English is not very good.
I hope they can help me with my problem and that I can continue learning, thanks very much!
It’s probably easiest to pull this off if you set the rectMode() to CENTER. Here’s a basic example to riff-off:
void setup() {
// draw rectangles from the center (not top-left)
rectMode(CENTER);
}
int size = 0;
void draw() {
// move the origin to the center of the display window
translate(width/2, height/2);
// draw a rectangle
rect(0, 0, size, size);
// increment the size value
size ++;
}
Among other additions, you’ll need to add a loop to draw multiple rectangles, alternating the fills of each.