int inter; PImage leonardo; void setup(){ size (970,600, P3D); noFill(); leonardo = loadImage("dni_leonardo.jpg"); } void draw() { background (0); float x = mouseX; inter = int(1.5*x/100); rectangulo (x); } void rectangulo (float x) { for (int i=inter; i>0; i--) { stroke (0,250,0); strokeWeight (2); float y = x/1.618; rect(0, 0, x, y); image(leonardo, 0, 0, x, y); rect(0,0,y,y); cachoespiral(y); translate (x, 0); rotate (PI/2); x=y; } } void cachoespiral (float y) { stroke (255,0,0); strokeWeight (5); arc(y,y, y*2, y*2, PI, TWO_PI-PI/2); }