Close

studio ponnuki is a small creative studio hidden in the beautiful mountains of the kootenays

gef_round
geoffroy

Designer / Hacker / Maker

Loves green tea, meditation and noise

melina_round
melina

Photo / Fashion / Accounting

In house yoga teacher and Thais massage, run http://yinyogi.com

naome_round
naima

Drawing / Dirt Pudding / Maker

Loves green tea, meditation and noise

Articles

Find Us

We are based in one of the most beautiful places on earth. Come visit us!

May 8, 2010

video and processing

I haven’t received my new video camera yet so I will have to delay the post about my audio mixer ~ so I decided to post some example of other project I am tinkering with. This is a small video project that I did in processing. This is only the output of the project. video processing screen shot

I am using an eyetoy – the web cam for the playstation2 that I got on ebay for 99c, and running the project on pure:dyne. In order to use video on processing in linux, you need to use an extra video library gsvideo. It’s a really great library that work really well and that is really fast. I read previously that video on processing in linux could be hard – but it is really easy and fun.

Here is the code ~ it’s created half randomly testing rotation, pop and push matrix,a dding some structures in 3d:

import codeanticode.gsvideo.*;
GSCapture cam;
float a = 0; // the variable used for the rotation

void setup() {
size(800, 600,P3D);
cam = new GSCapture(this, 320, 240);
}

void draw() {
background(0);
camera(-1000+mouseX*6, -1000+mouseY*6, 800, 90.0, 50.0, 0.0, 0.0, 1.0, 0.0); // camera controled by the mouse

if (cam.available() == true) {
cam.read();
filter(DILATE); //some test on filters - I wasn't too sucessful yet
translate(320,240);

pushMatrix(); // here is the construction of the
rotateY(a*PI); // video - a bit a random trying to create shape and mouvements
image(cam, -320,-240,320,240);
image(cam, 0,0,320,240);
image(cam, 320,240,20,40);
image(cam, -620,-340,80,70);
image(cam, -320,-240,320,240);
image(cam, -320,-240,320,240);
image(cam, -320,-240,320,240);
stroke(255,0,0);
noFill();
box(120);
rotateX(PI/2);
image(cam, -320,-240,320,240);

for (int i = 0; i < mouseY/20; i++){
image(cam, random(0,(width-164)),random(0,(height-48)),64,48);
}
popMatrix();
pushMatrix();

rotateY(a*PI+PI/2);
image(cam, -320,-240,320,240);
rotateX(a*PI+PI/2);
image(cam, -320,-240,320,240);
rotate((-a));
box(80);
popMatrix();

a = a+0.01; // for the rotation
}
}

And here is an output of the video. The movement is controled by the mouse