Here is the final version
Written on December 8, 2008
I am including the code and links in this post. The philosophical stuff will come this evening. The first link is a small compact video. Quality is not fabulous, (IMHO) but it communicates the process. The second and third video links are much larger (1080p) and raw footage, but you can make out the details a lot better.
http://www.gravatonia.com/Weldon_final.mov
http://www.gravatonia.com/raw1.MOV
http://www.gravatonia.com/raw2.MOV
And here is the final (for now) version of the code:
import JMyron.*;
JMyron m;
void setup(){
int w = 640;
int h = 480;
frameRate=15;
size(w,h);
m = new JMyron();
m.start(640,480);
m.findGlobs(1);
println(”Myron ” + m.version());
}
void mousePressed(){
m.settings();
}
void draw(){
m.trackColor(255,255,255,255);
m.update();
int[] img = m.image();
//first draw the camera view onto the screen
loadPixels();
for(int i=0;i<width*height;i++){
pixels[i] = img[i];
}
updatePixels();
background(int(random(5)),int(random(5)),int(random(5)));
//draw edge pixels of globs (this and the next chunks of code are chokers)
int list[][][] = m.globPixels();
stroke(235+int(random(15)),240+int(random(10)),250);
for(int i=0;i<list.length;i++){
int[][] pixellist = list[i];
if(pixellist!=null){
beginShape(POINTS);
for(int j=0;j<pixellist.length;j++){
if(j%2!=0){
line( pixellist[j][0]+int(random(4)), pixellist[j][1]+int(random(4)),pixellist[j][0]+int(random(-4)), pixellist[j][1]+int(random(-4)));
}
if(j%5==0){
line( pixellist[j][0]+int(random(6)), pixellist[j][1]+int(random(6)),pixellist[j][0]+int(random(-6)), pixellist[j][1]+int(random(-6)));
}
}
endShape();
}
}
}
public void stop(){
m.stop();
super.stop();
}
Though it does run at 24 and 30 FPS, I found it smoothest at 15 and 18 FPS. Only weakness is it tended to fall apart if I went over 720 by 480 and I could figure out how to get it to go full screen. Suggestion on that one would be HIGHLY appreciated.
Grav
Filed in: _Announcements.
