lunes, 26 de marzo de 2012

clase 26 marzo

void setup(){
size (400,400);
}
void draw(){
for (int i = 5; i < 100; i += 5) {
stroke (255,0,0);
line (30,i,80,i);  }
//  if(i < 45) {
// else if (i < 65) {stroke(0,255,0); line (20,i,90,i); }
// else if (i < 100) { stroke(0,0,255); line (0,i,100,i); }
  }
}

..........................................


void setup(){
size (400,400);
}
void draw(){
for (int i = 5; i < 100; i += 5) {
if(i < 45){
    stroke (255,0,0);  //color borde
    line (30,i,80,i);  //linea
}
else if (i < 65) {stroke(0,255,0); line (20,i,90,i); }
else if (i < 100) { stroke(0,0,255); line (0,i,100,i); }
}
  }


..........................................

void setup() {
frameRate (50); //fotogramas por segundos
}
int posicion = 0;
void draw() {
background(204);
posicion++;
line (posicion,20,posicion,80);
if(posicion > width) {
  posicion = 0;
  }
}

..........................................

int pos = 2;
int bcolor = 255;
void setup (){
  size (300,300);
  frameRate (10);
}

void draw (){
pos++;
bcolor--;
for(int i = 5; i < 50; i += 10) {
fill(bcolor,bcolor,random (600));
noStroke();
rect(10,i,pos,10);
if (pos == 255){
// noLoop();
   }
   }
 }

..........................................

float trasparencia= 0.0; //variable con decimales

void setup(){
frameRate(30);
size(400,400);
background(0);
}
void draw (){
  for(int i=0; i < 200; i++) {
  for(int j=0; j < 200; j++) {
 //random
float r = random (0,255);
stroke(r);
point(i,j);
  }
  }
}

..........................................

float posicion= 0.0; //variable con decimales

void setup() {
frameRate(100); //velocidad
size(400,400);
background(0);
}
void draw (){
  posicion = posicion + .01;
  float n = noise(posicion) * height;
  strokeWeight(20);
  stroke(random(147), random(28), random(145), 15);
  line(n,0,n,400);
}


..........................................


//variables

int diam = 10; //diametro
float centX, centY; // tamaño de la elipse
void setup() {
  size (500,500);
  frameRate(40); //velocidad
  smooth(); //suavizado
  background(180);
  centX = width/2; //ancho dividido dos
  centY = height/2; //alto dividido dos
  noFill(); //sin relleno
  }
void draw() {
//si diam es menor o igual a 400 pasa algo
if(diam <= 700) {
stroke(114,random(226),133); // color borde
strokeWeight(20); //ancho
//background(180);
//dibuja elipse
ellipse(centX,centY,diam,diam);
//suma el diametro 10 pixeles
diam += 5;
    }
  }

No hay comentarios:

Publicar un comentario