lunes, 10 de septiembre de 2012

clase del 10 de septiembre

ejercicio 1:


/* graficar linea */

size(480,120); //tamaño del documento
smooth(); //suavisar la linea
strokeWeight(8); //ancho de linea
line(20,40,60,80); //dibujamos la linea en el plano


ejercicio 2:


/* ciclo for */

size(480,120); //tamaño del documento
smooth(); //suavisar la linea
strokeWeight(8); //ancho de linea
line(20,40,60,80); //dibujamos la linea en el plano
line(40,40,80,80);


ejercicio 3:


/* ciclo for (trama repetida de un objeto determinado)*/

size(480,120); //tamano sketch
smooth();
strokeWeight(8); //anchio linea
//el ciclo for es un contador que cuenta
//una cantidad de veces segun una condicion
//determinada
for(int i=20; //variable y valor
    i <400; //si es menora 400
    i +=60) { //le suma i 60
  rect(i,40,i,80);
}


ejercicio 4:

size(480,120); //tamano sketch
background(0);
smooth();
noStroke(); //anchio linea
//for (int y = 0;y <= height; y += 40) {
 //reconoce el ancho total de la aplicacion
for(int x=0; x<= width; x +=40) {
    fill(random(255), random(255), random(255),
    random(255));
    ellipse (x,y,40,40);
}
}

ejercicio 5:

// void= vendria siendo una funcion
//funciuon es una accion que va a cumplir el programa
//siempre la funcion se le da un nombre (){}
//la funcion que cumple siempre va a estar dentro de las llaves
//setup es para setear el programa, es decir,
//cosas que no se van a modificar
void setup() {
  println("estoy partiendo");
}
//aqui los objetos van siendo modificados en la ejecucion
// del programa

void draw() {
  println("estoy ejecutando");
}

ejercicio 6:

void setup() {
  size(480,120);
  fill(0,102);
  smooth();
  noStroke();
}

void draw() {
  //background(204);
  //ellipse(mouseX, mouseY,9,9);
  ellipse(0,0,9,9);
}
  
ejercicio 7:

void setup() {
  size(480,120);
  fill(0,102);
  smooth();
  noStroke();
}

void draw() {
  //background(204);
  ellipse(mouseX, mouseY,9,9);
  ellipse(0,0,9,9);
}
  

ejercicio 8:


void setup () {
  size (240,120);
  smooth ();
  strokeWeight (30);
}
void draw () {
  background (204);
  stroke (103);
  line (40,0,70,height);
  //if (mousePressed == true) {
    // stroke(0);
    //}
    line (0,70,width,50);
}


 ejercicio 9 (ejercicio 8 pero variado):


void setup () {
  size (240,120);
  smooth ();
  strokeWeight (30);
}
void draw () {
  background (204);
  stroke (103);
  line (40,0,70,height);
  if (mousePressed == true) {
    stroke(0);
    }
    line (0,70,width,50);
}

ejercicio 10 (movimiento del teclado):


void setup () {
  size (240,120);
  smooth ();
}
void draw () {
  background (204);
  line (20,20,220,100);
  if (keyPressed) {
    line (220,20,20,100);
}
}

ejercicio 11:


void setup () {
  size (240,120);
  smooth ();
}
void draw () {
  background (204);
  //condicional multiple nos permite trabajar con multiples teclas
  if (keyPressed) {
    if ((key == 'h') || (key == 'H')) {
      line (30,60,90,60);
    }}
    if ((key == 'n') || (key == 'N')) {
    
    line (30,20,30,100);
    line (90,20,90,100);
  }
}

ejercicio 12:


//variable nombre x 215
int x = 215;
void setup () {
size (480,120);
}
void draw () {
 if (keyPressed && (key == CODED)) {
    if (keyCode == LEFT) {
      x--; //restar en un punto el valor de x
    }
    //else if (keyCode == RIGHT) {
      // x++; //suma en un punto el valor de x
      //}
  }
  rect (x,45,50,50);
}



lunes, 27 de agosto de 2012

27 de agosto

ejercicio 1:

/*01 carga imagen*/
/*variable de la imagen,
tipo de la variable define
lo que es*/

size(500,500);
PImage lobo; //variable imagen
lobo =loadImage("lobo.jpg"); //cargar imagen
image(lobo,20,20,350,300); //graficar imagen

ejercicio 2 :

/*01 carga imagen*/
/*variable de la imagen,
tipo de la variable define
lo que es*/

size(500,500);
//color amarillo = color(220,214,41);
PImage lobo; //variable imagen
lobo =loadImage("lobo.jpg"); //cargar imagen
tint(55);//tinte, 25 brillante, 0 opaco
image(lobo,0,0,400,400); //posicion imagen
noTint();
image(lobo,50,0,200,150);


ejercicio 3:



/*01 carga imagen*/
/*variable de la imagen,
tipo de la variable define
lo que es*/

size(500,500);
//color amarillo = color(220,214,41);
PImage lobo; //variable imagen
PImage conejo;
lobo =loadImage("lobo.jpg"); //cargar imagen
conejo =loadImage("conejo.jpg");
tint(55);//tinte, 25 brillante, 0 opaco
image(lobo,0,0,400,400); //posicion imagen
noTint();
image(conejo

ejercicio 4: 

/*01 carga imagen*/
/*variable de la imagen,
tipo de la variable define
lo que es*/

size(500,500);
//color amarillo = color(220,214,41);
PImage lobo; //variable imagen
PImage conejo;
lobo =loadImage("lobo.jpg"); //cargar imagen
conejo =loadImage("conejo.jpg");
tint(55);//tinte, 25 brillante, 0 opaco
image(lobo,0,0,400,400); //posicion imagen
noTint();
image(conejo,50,0,200,150);


ejercicio 5:

/*01 carga imagen*/
/*variable de la imagen,
tipo de la variable define
lo que es*/

size(500,500);
color amarillo = color(220,214,41);
PImage lobo; //variable imagen
PImage conejo;
lobo =loadImage("lobo.jpg"); //cargar imagen
conejo =loadImage("conejo.jpg");
tint(55);//tinte, 25 brillante, 0 opaco
image(lobo,0,0,400,400); //posicion imagen
noTint();
image(conejo,50,0,200,150);
tint(amarillo);
image(lobo,100,0);

ejercicio 6:

/*01 carga imagen*/
/*variable de la imagen,
tipo de la variable define
lo que es*/

size(500,500);
color amarillo = color(220,214,41);
PImage lobo; //variable imagen
PImage conejo;
lobo =loadImage("lobo.jpg"); //cargar imagen
conejo =loadImage("conejo.jpg");
tint(55);//tinte, 25 brillante, 0 opaco
image(lobo,0,0,400,400); //posicion imagen
tint(amarillo);
image(conejo,50,0,200,150);
tint(amarillo);


ejercicio 7:

/*01 carga imagen*/
/*variable de la imagen,
tipo de la variable define
lo que es*/

size(500,500);
color amarillo = color(220,214,41);
PImage lobo; //variable imagen
PImage conejo;
lobo =loadImage("lobo.jpg"); //cargar imagen
conejo =loadImage("conejo.jpg");
tint(55);//tinte, 25 brillante, 0 opaco
image(lobo,0,0,400,400); //posicion imagen
tint(amarillo);
image(conejo,50,0,200,150);
tint(amarillo);

ejercicio 8:

/*01 carga imagen*/
/*variable de la imagen,
tipo de la variable define
lo que es*/

size(500,500);
color amarillo = color(220,214,41);
PImage lobo; //variable imagen
PImage conejo;
lobo =loadImage("lobo.jpg"); //cargar imagen
conejo =loadImage("conejo.jpg");

tint(55);//tinte, 25 brillante, 0 opaco
image(lobo,0,0,400,400); //posicion imagen

noTint();//no contiene amarillo
image(conejo,50,0,200,150);

tint(amarillo);//contiene tinte amarillo
image(lobo,50,200,200,250);// posision segunda imagen


ejercicio 9:

/*transparencia*/

PImage lobo; //variable imagen
PImage conejo; //variable imagen
size(400,400); //tamaño sketch
lobo =loadImage("lobo.jpg"); //cargar imagen
conejo =loadImage("conejo.jpg"); //cargar imagen
background(255); //fondo blanco

tint(255,102);//tinte, 25 brillante, 0 opaco
image(lobo,0,0,200,200);//posicion imagen

tint(255,204,0,153);//R,G,B (color), transparencia
image(conejo,60,60,100,100);//posicion segunda imagen

/*color amarillo = color(220,214,41);
PImage lobo; //variable imagen
PImage conejo;
lobo =loadImage("lobo.jpg"); //cargar imagen
conejo =loadImage("conejo.jpg");

tint(55);//tinte, 25 brillante, 0 opaco
image(lobo,0,0,400,400); //posicion imagen

noTint();//no contiene amarillo
image(conejo,50,0,200,150);

tint(amarillo);//contiene tinte amarillo
image(lobo,50,200,200,250);// posision segunda imagen*/

ejercicio 10:


/*fuentes*/

PFont fuente;
fuente = loadFont("Monospaced-48.vlw");
size(400,400);//tamaño sketch
textFont(fuente);//define tipografia
fill(0);//color fuente negro
text("vision",0,40);//posicion letras
fill(250,30,50);//color fuente rojo
text("ver",0,70);//posicion letra
fill(50,120,20);// color fuente verde
text("vista",0,100);//posicion letra

ejercicio 10:


/*fuentes*/

PFont fuente;
fuente = loadFont("AppleMyungjo-48.vlw");
size(400,400);//tamaño sketch
textFont(fuente);//define tipografia
fill(0);//color fuente negro
text(19,0,40);//posicion numeros sin ""
text(72,0,70);//posicion nuemeros sin ""
text("R",0,100);//posicion letra


ejercicio 11:


size(400,400);//tamaño sketch
PFont fuente;
fuente = loadFont("AppleMyungjo-48.vlw");
size(400,400);//tamaño sketch
textFont(fuente);//define tipografia
fill(0);//color fuente negro
String s = "la vida se extingue los sueños jamás";
/*los valores arman una caja de texto,
text(s,x1,x1,width,heigth);*/
text(s,100,20,200,400);


ejercicio 12:

/*trasladar*/

rect(0,5,70,30);//rectangulo 1
translate(10,30);//transladar punto de inicio en x e y
rect(0,5,70,30);//rectangulo 2

/*tanslate(10,30);
rect(0,5,70,30);
*/

ejercicio 13:

/*rotacion*/

void setup(){//setea el programa
 size(200,200);
 background(255);//color de fondo
 smooth();//suavizar figura
 fill(192);//color figura
 noStroke();//sin borde
 rect(40,40,40,40);//rectangulo
}


ejercicio 14:


void setup(){//setea el programa
 size(200,200);
 background(255);//color de fondo
 smooth();//suavizar figura
 fill(192);//color figura
 noStroke();//sin borde
 rect(40,40,40,40);//rectangulo
 pushMatrix();
 translate(40,40);
 fill(0);
 rect(0,0,40,40);
 fill(255,0,0);
 rect(0,0,10,10);
 popMatrix();
}

ejercicio 15:


void setup(){//setea el programa
 size(200,200);
 background(255);//color de fondo
 smooth();//suavizar figura
 fill(192);//color figura
 noStroke();//sin borde
 rect(40,40,40,40);//rectangulo
 pushMatrix();
 translate(40,40);
 fill(0);
 rect(0,0,40,40);
 fill(255,0,0);
 rotate(radians(45));
 rect(0,0,20,20);
 popMatrix();
}

ejercicio 16:


void setup(){//setea el programa
 size(200,200);
 background(255);//color de fondo
 smooth();//suavizar figura
 fill(192);//color figura
 noStroke();//sin borde
 rect(40,40,40,40);//rectangulo
 pushMatrix();
 translate(40,40);//traslador punto de inicio
 fill(0);
 rect(0,0,40,40);
 fill(255,0,0);
 rotate(radians(45));
 rect(0,0,20,20);
 popMatrix();

 pushMatrix();
 translate(100,100);//traslador punto de inicio
 fill(230);
 scale(2.0); //agrandar imagen
 rotate(radians(45));//rotar
 rect(0,0,40,40);
 popMatrix();
}







lunes, 20 de agosto de 2012

ejercicio 1.2

sin borde y suavizado

fill(242,141,7);
size (500,500); // tamaño del sketch
noStroke();
smooth();
fill(8,253,50); // circulo verde
ellipse (50,50,50,50);
noStroke();
fill (5,114,245);//ciculo azul
ellipse (70,70,70,70);
noStroke();
fill (237,194,19);//circulo ocre
ellipse (90,90,90,90);
noStroke();
fill (255,3,19);//circulo rojo
ellipse (99,110,110,110);
noStroke();
fill (250,149,255);//circulo rosado
ellipse (100,130,130,130);
noStroke();
fill(249,250,10);//circulo amarillo
ellipse (110,150,150,150);
noStroke();
fill (180,180,162);//circulo gris verdoso
ellipse (115,170,170,170);
noStroke();
fill (3,211,250);//circulo celeste
ellipse (120,190,190,190);
noStroke();
fill (198,11,4);//circulo rojo
ellipse (125,210,210,210);
noStroke();
fill (0,4,64);//circulo negro
ellipse (130,230,230,230);
noStroke();
fill (27,147,96);//circulo verce oscuro
ellipse (135,250,250,250);
noStroke();
fill (99,240,19);//circulo verde claro
ellipse (140,230,230,230);
noStroke();
fill (156,173,146);//circulo gris
ellipse (145,210,210,210);
noStroke();
fill (151,77,162);//circulo morado
ellipse (150,190,190,190);
noStroke();
fill (7,0,8);//circulo negro
ellipse (155,170,170,170);
noStroke();
fill (232,227,131);//circulo amarillo ocre
ellipse (160,150,150,150);

tarea processing 1


size (500,500);
fill(8,253,50);
ellipse (50,50,50,50);
fill (5,114,245);
ellipse (70,70,70,70);
fill (237,194,19);
ellipse (90,90,90,90);
fill (255,3,19);
ellipse (99,110,110,110);
fill (250,149,255);
ellipse (100,130,130,130);
fill(249,250,10);
ellipse (110,150,150,150);
fill (180,180,162);
ellipse (115,170,170,170);
fill (3,211,250);
ellipse (120,190,190,190);
fill (198,11,4);
ellipse (125,210,210,210);
fill (0,4,64);
ellipse (130,230,230,230);
fill (27,147,96);
ellipse (135,250,250,250);
fill (99,240,19);
ellipse (140,230,230,230);
fill (156,173,146);
ellipse (145,210,210,210);
fill (151,77,162);
ellipse (150,190,190,190);
fill (7,0,8);
ellipse (155,170,170,170);
fill (232,227,131);
ellipse (160,150,150,150);