I'm trying to get a set of frames from a web cam and analyse them: take a angled slice through the set. Now I've got some capturing and drawing of a range of frames working. But it seams I'm only getting one frame captured and drawn over the whole range. Can anyone look at the capturing and specifically at the saving of the frames and see what i'm doing wrong?
void updateSlice() { loadPixels(); int imagesLength = images.length;
Plane plane = new Plane(new Vec3D(0,2,8),new Vec3D(0.5,0.9,0.1).normalize()); Ray3D ray = new Ray3D(new Vec3D(0,0,0),new Vec3D(0.3,0.6,0.8).normalize());
for(int i = 0; i < imagesLength; i++) { for(int x = 0; x < 800; x++) { for(int y = 0; y < 600; y++) { ray.x = x; ray.y = y; float dirtyDepth = plane.intersectRayDistance(ray); int depth = round(dirtyDepth); //println("depth:" + depth); if(-1 < depth && depth < imagesLength) { //println("x:" + x + ":y:" + y + ":depth:" + depth); //println("imagesLength:" + imagesLength); //println("i:" + i); loadPixels(); //println("slice:" + slice.pixels.length); //println("slice.pixels:" + slice.pixels[0]); if(images[i] != null) { //println("image"); images[i].loadPixels(); slice.set(x, y, images[i].get(x, y)); } } } } } }