So I'm new to processing (and javascript in general) but I spent several hours today troubleshooting with our coder and we couldn't figure out why this wasn't working.
Basically, I want to save all the data I'm getting out of the kinect. I have my script which samples points, and all I want to do is write them out to files so that I can access them in c4D or other programs.
(There are pre-made scripts out there that accomplish this, but end up greatly reducing the resolution of the kinect camera, which doesn't work for my project. Besides, I want all the data, not some of it!)
Here's my script, cobbled together from SimpleOpenNI templates and other sources.
point(realWorldPoint.x, realWorldPoint.y, realWorldPoint.z); // make realworld z negative, in the 3d drawing coordsystem +z points in the direction of the eye
pointList.add( new PVector(realWorldPoint.x, realWorldPoint.y, realWorldPoint.z) );
OUTPUT.println(i+", "+V.x+", "+V.y+", "+V.z); // here we export the coordinates of the vector using String concatenation!
}
OUTPUT.flush();
OUTPUT.close();
}
}
}
Basically, every time a new frame occurs (currentFile++), the script stores the array of points into an array of frames. Then, when I hit backspace, it should go through that array of frames, access the array of points at that frame, and write out to a text file one after the other. HOWEVER, all the files are the same.