01/09/2008

loop le monkey | processing.org

Eu ia traduzir a apresentação do processing, mas fiquei com preguiça... então, aí vai o texto original em inglês mesmo:

Processing is an open source programming language and environment for people who want to program images, animation, and interactions. It is used by students, artists, designers, researchers, and hobbyists for learning, prototyping, and production. It is created to teach fundamentals of computer programming within a visual context and to serve as a software sketchbook and professional production tool. Processing is an alternative to proprietary software tools in the same domain.
Mais info no site processing.org

Ser geek é.... escrever o próprio software!




Pra quem se interessar, aí vai o código usado pra gerar o video acima:

import processing.video.*;

MovieMaker mm;

int cellSize = 16;
int cols, rows;
Capture video;


void setup() {
size(630, 480, P3D);
cols = width / cellSize;
rows = height / cellSize;
colorMode(RGB, 255, 255, 255, 100);
rectMode(CENTER);

video = new Capture(this, width, height, 15);
mm = new MovieMaker(this, 640, 480, "pixel4_rotate.mov", 15, MovieMaker.ANIMATION, MovieMaker.MEDIUM);
background(0);
}


void draw() {
if (video.available()) {
video.read();
video.loadPixels();

background(0, 0, 0);


for (int i = 0; i < cols;i++) {
for (int j = 0; j < rows;j++) {

int x = i * cellSize;
int y = j * cellSize;
int loc = (video.width - x - 1 ) + y*video.width;
color c = video.pixels[loc];
float sz = (brightness(c) / 255.0) * cellSize;
fill(0, 200, 200, 75);
noStroke();
ellipseMode(CENTER);
ellipse(x + 1 + cellSize/2, y + 1 + cellSize/2, sz, sz);
fill (128, 128, 0, 75);
ellipse(x + 3 + cellSize/2, y + 2 + cellSize/2, sz, sz);
fill (0, 0, 200, 75);
ellipse(x - 3 + cellSize/2, y + 2 + cellSize/2, sz, sz);


}
}
mm.addFrame();
}
}

void keyPressed(){
if (key==' '){
mm.finish();
}
}

Nenhum comentário:

Related Posts with Thumbnails
 
BlogBlogs.Com.Br