Hola. Estoy desesperada con Processing. Tengo un objeto que he modificado con un ejemplo de Processing y necesito multiplicarlo con “clases” y moverlo tipo viento. También que lleve una foto de fondo. ¿Cómo lo hago? AYUDA!!!
PFont f;
float r = 50;
float theta = 50;
float w = 20;
float h = 20;
void setup() {
size(500,500);
background(255);
smooth();
}
void draw() {
float x = r * cos(theta);
float y = r * sin(theta);
background(255);
noStroke();
fill(250,250,8);
ellipse(x =250, y =250, 70, 70);
stroke(60,120,54);
fill(255);
bezier (250,310,240,260,250,500,400,470);
noStroke();
fill(20,130,5);;
arc (300,400,10,80,20,60);
translate(width/2, height/2);
noFill();
stroke(0);
ellipse(0, 0, r*1.5, r*1.5);
int totalBoxes = 16;
float arclength = 0;
for (int i = 0; i < totalBoxes; i ++ ) {
arclength += w/2;
float theta = arclength / r;
pushMatrix();
translate(r*cos(theta) , r*sin(theta));
rotate(theta);
fill(255);
rectMode(CENTER);
rect(0, 0, w, h);
popMatrix();
arclength += w/2;
}
}