Macarena Ramdohr Proyecto - Imagen Escrita T1 2019

De Casiopea

Código grilla

Grilla macarena ramdohr.png


int cellSize = 30; //defino la cantidad de cuadrados que caben en el canvas int edge = 100; //centro la imagen a través de los margenes

void setup() {

 size(600,600, P2D); //defino el espacio del canvas
 smooth(10);
 rectMode(CENTER);
 background(255,163,163); //aplico el rosa de fondo
 for (int x=edge+cellSize/2; x<=width-edge; x+=cellSize) {
   for (int y=edge+cellSize/2; y<=height-edge; y+=cellSize){
     //si (random(1)>0.1)
     drawThing(x,y);
   }
 }

}

void draw() { }

void drawThing(float x, float y) { //se dibuja la grilla de cuadrados

 float sz = map(y,0,height,cellSize*1, cellSize*0.5);
 sz = cellSize*0.8;
 float sz2 = map(y,0,height,cellSize*.1, cellSize*1);
 sz2 = cellSize*.7;
 float r = map(y,0,height, 5,25 );
 float px = map(x,0,width,-cellSize/3,cellSize/3);
 float py = map(y,0,height,-cellSize/3,cellSize/3);
 float offSet = map(y,0,height, 0,PI);
 noStroke();
 fill(255,163,163);
 int num = 8;
 for (int i=0; i<num; i++) {
   pushMatrix();
   translate(x,y);
   rotate(radians(r)); //rotar circulos rosa
   stroke(4);
   noFill();
   rect(0,0,sz,sz);
   rect(0,0,sz/2,sz/2);
   noStroke();
   fill(255,163,163); //relleno el círculo del mismo color para borrar sus bordes
   ellipse(px,py,sz2, sz2);
   popMatrix();
 }

}