Processingで2台のWebカムをキャプチャ


import processing.video.*;
 
Capture myCapture1;
Capture myCapture2;
 
void setup() {
  size(640*2, 480);
  myCapture1 = new Capture(this, 640, 480, 30);
  myCapture2 = new Capture(this, 640, 480, 30);
}
 
void draw() {
  if (myCapture1.available() && myCapture2.available()) {
    myCapture1.read();
    myCapture2.read();
    image(myCapture1, 0, 0);
    image(myCapture2, 640, 0);
  }
}