Favio Matus Pizarra de líneas

De Casiopea



TítuloFavio Lineas color
Tipo de ProyectoProyecto de Curso
Palabras Clavetarea 5
Del CursoImagen Escrita 2012,
CarrerasDiseño Gráfico"Diseño Gráfico" is not in the list (Arquitectura, Diseño, Magíster, Otra) of allowed values for the "Carreras Relacionadas" property.
Alumno(s)Favio Matus
ProfesorHerbert Spencer


float[][] coords; int maxPuntos; int c; int a=2; void setup() {

 size(700, 700);
 c = 0;  
 maxPuntos = 1000;
 coords = new float[maxPuntos][2];
 strokeWeight(2);
 stroke(255);
 background(0);

}

void draw() {

 if (mousePressed) {
   coords[c][0] = mouseX;
   coords[c][1] = mouseY;
   println(c);
   c ++;
 }

 for (int i = 0; i <= c; i++) {
 strokeWeight(a);
   point(coords[i][0], coords[i][1]);

if(mouseButton== RIGHT){

 background(0);
 c=0;
 }

 }

}


void connect1() {

 for (int i = 0; i <= c; i++) {
   for (int j = 0; j < i; j++) {
 line(coords[i][0]+mouseX, coords[i][1]+second(), coords[j][0], coords[j][1]);
  

} } }

void keyPressed(){

if(key=='1'){

rect(50,50,500,500);
background(0);
   stroke(#08A72C);
   connect1();
 }
if(key=='2'){
 rect(50,50,500,500); 
background(0);
stroke(#D8D218);
  connect1();

} if(key == '3'){

 rect(50,50,500,500);
background(0);
stroke(#BC0909);
  connect1();

} if (key=='4'){

rect(50,50,500,500);
background(0);
stroke(#1629F0);
  connect1();

} if(key== '5'){

rect(50,50,500,500);
 background(0);
 stroke(#F0742C);
   connect1();

}


}