Módulo II — Processing (1/2)

Módulo II

Composição & Desenho e Manipulação de Texto



Repetição e Rotação

exercicio_2.1

Código:

size (320,400);
background (255,255,150);

noFill ();
stroke(0,0,155);

int x = 50;
int y = 50;
int n = 0;

while (n < 100) {
  circle (x , y, 50);
  y = y + 3;
  n = n + 1;
}

 int x4 = 260;
int y4 = 50;
int n4 = 0;

while (n4 < 100) {
  circle (x4 , y4, 50);
  y4 = y4 + 3;
  n4 = n4 + 1;
}


push ();
translate (-20,50);
rotate (radians (315));
int x2 = 50;
int y2 = 50;
int n2 = 0; 

while (n2 < 50) {
  circle (x2 , y2, 50);
  y2 = y2 + 3;
  n2 = n2 + 1;
}
pop();

push ();
translate (260,-20);
rotate (radians (45));
int x3 = 50;
int y3 = 50;
int n3 = 0; 

while (n3 < 50) {
  circle (x3 , y3, 50);
  y3 = y3 + 3;
  n3 = n3 + 1;
}
 pop();
 
  save("exercicio_2.1.png");

Deixe um comentário