greg
YaBB Newbies
Offline
Posts: 5
Much slower in p87 than p68
May 7th , 2005, 9:42pm
Hello all, I'm new to Processing, so please excuse my ignorance... I can't figure out why the following code runs at a decent framerate in p68: ******************** void setup() { size(640, 560); beginVideo(320, 240, 30); background(0); } void loop() { image(video, 320, 320); replicate(1, 0, 321, 560, 0, 0, 320, 560); replicate(0, 1, 640, 321, 0, 0, 640, 320); } ******************** But editing the code to work in p87 as follows runs at about 1 fps: ******************** import processing.video.*; Capture myCamera; void setup() { size(640, 560); println(Capture.list()); String captureDevice = "IIDC FireWire Video"; myCamera = new Capture(this, captureDevice, 320, 240, 30); } void captureEvent(Capture myCamera) { myCamera.read(); } void draw() { image(myCamera, 320, 320); copy (1, 0, 321, 560, 0, 0, 320, 560); copy (0, 1, 640, 321, 0, 0, 640, 320); } ******************** On a related note, I'd like to store each frame of video into a 3D box with the current frame projected on the front. Then, I want to be able to look at the box from an orthographic projection and see the resulting top and side views. Eventually, I'd like to be able to view slices through the box at different angles to see interesting changes of the video through time. I'm thinking something along the lines of a very stripped down version of this: http://www.k2.t.u-tokyo.ac.jp/members/alvaro/Khronos/Khronos_Projector.htm In the meantime, I'm so new to processing and programming in general that I can't figure out how to store the video in the first place. :\ Any suggestions are greatly appreciated.