miércoles, 16 de noviembre de 2011

triangulos

Codigo de proyecto

float contorno , figura,forma;

void setup(){
  
    size(640,450);
    smooth();
    colorMode(RGB);
    contorno = 400;
    figura = 340;
}



void draw(){
  
  forma+=0.130;
  if(forma > 280) forma = 0;
  
  background(255);

 if( mouseX > 3 ) contorno = mouseX;
 if( mouseY > 3 ) figura = mouseY/2;


 
 for ( int x = 0; x < width/8; x++) {
    for ( int y = 0; y < height/8; y++){
            

          
              strokeWeight(8);
         stroke(255,0,183);
         fill(forma,255,0);    
         tri ( x * contorno, y * contorno, figura );
        }
    }
}


void tri ( float _x, float _y, float _size  ) {
   float trisize = _size;
  float x , y;
  x = _x;
  y = _y;
  pushMatrix();
  translate( x, y);
  triangle( -trisize, trisize, trisize/6,-trisize, trisize+ trisize/10, trisize );
  popMatrix();
}

martes, 15 de noviembre de 2011

imagen con texto

PFont font;

void setup(){
size(400,120);
smooth();
font= loadFont("AgencyFB-Reg-48.vlw");
textFont(font);
}

void draw (){
background (102);
textSize(45);
text("rocio !!!",25,60);
}

incorporar imagen a processing

PImage img; // se declaran las variables
void setup () {
size (480, 120);
img = loadImage ("GFFDHG.jpg"); // se nombra cual es la imagen correspondiente ala variable
}
void draw () {
  image (img ,0,0); // nombre imagen,posicion , posicion
}

lunes, 14 de noviembre de 2011


size (400,400);
background (000000);
smooth ();
noStroke();
fill (#33FF33);
triangle ( 200,20,180,70,220,70);
fill (#009933);
triangle ( 200, 90, 160,150,240,150);
fill (#00FF00);
triangle (200,160, 180,230,220,230);
fill (#006600);
triangle ( 200, 240, 160, 350, 240, 350);
fill (#00CC66);
triangle ( 150, 250, 130, 280,170,280);
fill(#009900);
triangle ( 100, 200, 80, 230, 120 , 230);
fill(#66CC33);
triangle (50, 150, 30, 180, 70, 180);
fill(#99FF99);
triangle ( 250,250, 230, 280, 270, 280);
fill(#99CC00);
triangle ( 300,300,280,330,320,330);
fill(#00FF33);
triangle (350,350,330,380,370,380);

size (500,500);
background (207,0,255);
smooth ();
noStroke();
fill (218,54,255);
ellipse (20,20,20,20);
fill (228,120,252);
ellipse (40,40,30,30);
fill (233,137,255);
ellipse (70,70,40,40);
fill (247,222,252);
ellipse(110,110,50,50);
fill(255);
ellipse(160,160,60,60);
fill(189,160,196);
ellipse (210,210,50,50);
fill (153,100,165);
ellipse(250,250,40,40);
fill(120,58,134);
ellipse(280,280,30,30);
fill (92,32,106);
ellipse(305,305,20,20);
fill (148,75,165);
ellipse(330,330,30,30);
fill(169,109,216);
ellipse(360,360,40,40);
fill(238,176,252);
ellipse(400,400,50,50);
fill(255);
ellipse(450,450,60,60);

size (420,420);
background (19,0,85);

smooth ();
noStroke();
fill (47,44,149);
rect (20,20,20,20);
fill (79,76,188);
rect (40,330,40,40);
rect (330,40,40,40);
rect (50,50,40,40);
fill (128,125,222);
rect ( 100,260,60,60);
rect (260,100,60,60);
rect (100,100,60,60);
fill (201,199,250);
rect (170,170,80,80);
fill(128,125,222);
rect (260,260,60,60);
fill (79,76,188);
rect (330,330,40,40);
fill (47,44,149);
rect (380,380,20,20);
rect (20,380,20,20);
rect (380,20,20,20);