Category Archives: nature of code

Nature Of Code Final

My final idea is implementing neural networks on gesture recognition. I have started with one of Shiffman’s code. It is recognising ’0′ and ’1′, by using pixel data. So, I started with using this code and one finger. It was workin very well for ’0′ and ’1′ cause they are very different from each other, but using pixel data is not a very good way for similar objects. I found a Flash app at bytearray.org. They divided the mouse recordings in to arrays and give each direction different number(there is 8 direction). So, I got the mouse inputs which are not equal to previous mouse location and put 20 sample data in to database. Also I used – mouse vector length/ summation of all distance- for each sample in my database. That makes scalling easier. Actually, if we think about a triangle with sides 3,4,5 cm, what I am recording for each side is (according to directions) 3/12,4/12,5/12, and that makes scalling easier.

I am planing to make some more imporevements to this project and create a database which grove ups in it. My idea is letting people in ITP to correlate some gestures with their drawings. I have to work on this ide more during the summer.

Here is the processing app wit pixel data (need a camera)

Here is the processing app with vectors (works with mouse)

Nature Of Code Midterm

For my nature of code midterm I worked on a ball class. I am putting some balls on to screen according to time. Each ball has effected by gravity, and mouse. Also when ever they touch each other or to borders, they bounces. By pressing b, you can add more balls.

I am planing to use this application for my computational cameras midterm. It is going to be an application, that users can interact with balls with cameras. I am planing to make background removing, so I can get the edges of the person and let them play with the balls.

Here is the processing app.

Nature Of Code Midterm Idea

During the beginning of the first semester I saw Ole Kristensen’s dance project (Body Navigation) at processing.org. Since, I have worked on dance, and cameras before ITP, I really loved this performance and show it to my friends who I worked before. This is amazing. So, I want to continue on this path. I am also taking Computational Cameras and Thinking Physically, which overlaps with this idea. For my Computational Cameras class, I am planning to work on dancers and tracking their motions, and for Nature Of Code, I want to make some stage visuals for this idea.

Here are some example links:
http://halfdanj.dk/blog/2009/01/timemap-lab/
http://halfdanj.dk/blog/2008/05/body-navigation/

Nature Of Code Week-1

First weeks assignment is changing Dan Shiffman’s walker sample and trying to make a creature that moves with randomness. For this assignment I have worked on a snow animation.  Snow flakes are falling down randomly for this example. Also I tried to implement a wind effect with mouse, there are improvements in this effect in next weeks.

Here is the link for processing app.

midterm

During the beginning of the first semester I saw Ole Kristensen’s dance project (Body Navigation) at processing.org. Since, I have worked on dance, and cameras before ITP, I really loved this performance and show it to my friends who I worked before. This is amazing. So, I want to continue on this path. I am also taking Computational Cameras and Thinking Physically, which overlaps with this idea. For my Computational Cameras class, I am planning to work on dancers and tracking their motions, and for Nature Of Code, I want to make some stage visuals for this idea.

Here are some example links:

http://halfdanj.dk/blog/2009/01/timemap-lab/

http://halfdanj.dk/blog/2008/05/body-navigation/

import java.util.ArrayList;

import processing.core.*;

public class danceSketch extends PApplet {
PVector loc = new PVector(0,0);
PVector vel = new PVector(0,0);
PVector acc = new PVector(0,0);
float d = 10;
ball[] balls = new ball[10];
ArrayList ballsList;
public void setup(){
size(500,500);
ballsList = new ArrayList();

}

public void draw(){
background(255);
PVector mouse = new PVector(mouseX,mouseY);
loc = new PVector(random(d,width-d),0);

ballsList.add(new ball(this, loc));

//if(mouse.x != loc.x+d/2 && mouse.y != loc.y+d/2){//////this is not working

vel = new PVector(0,random(0.01f,1));
acc = new PVector(0,0.05f);

for(int i = ballsList.size()-1; i >= 0; i–){
ball balls = (ball) ballsList.get(i);
if(balls.loc.y >= height-d){
vel = new PVector(0,0);
acc = new PVector(0,0);
println(“in”);
}
balls.draw();
balls.move(vel,acc);
}
}

}

import processing.core.PApplet;
import processing.core.PVector;

public class ball {
PApplet parent;
float d;
PVector loc;
PVector vel;
PVector acc;
ball(PApplet p, PVector locP) {
parent = p;
loc = locP;

d = 10;
}
void draw(){
parent.fill(0);
parent.smooth();
parent.noStroke();
parent.ellipse(loc.x,loc.y,d,d);
}
void move(PVector velP, PVector accP){

vel = velP;
acc = accP;
loc.add(vel);
vel.add(acc);

}

}

nature of code

a basic colision detection and oscillation try…….

import processing.core.PApplet;
import processing.core.PVector;

public class nature3 extends PApplet{
/////how can I define other classes in eclipse
PVector loc;
int rectWidth = 50;
PVector Eloc ;
float theta = 0;
PVector acc= new PVector(0,0);
int r = 10;
int k = 5;
public void setup(){
size(1200,500);
loc = new PVector(200,height/2);
frameRate(100);
Eloc = new PVector(loc.x+(rectWidth/2),10);

}

public void draw(){
background(0);
loc.y = map(sin(theta),-1,1,50,10);
theta += 0.1f;
//loc.add(acc);
Eloc.y+=k;

smooth();
fill(255);
rect(loc.x,height,rectWidth,-100+loc.y);
fill(120,200,120);
ellipse(Eloc.x,Eloc.y,r*2,r*2);
float rectTop = height-100+loc.y;
float circle = Eloc.y+r;

if(circle>rectTop){
k=-5;
}    else if(circle<1){
k+=5;
}

}
}