出现了几个问题想请教大侠:1、三个摄像图片只有一个显示摄像内容,其他两个黑色(有没有什么方法,让三个都能显示相同的内容)
2、processing程序那个函数可以实现拍照
请大家多多指导,新手啦,以后学习的过程中还会麻烦大家滴
import processing.video.*;
Capture video1;
Capture video2;
Capture video3;
float x1;
float y1;
float s1=0.3;
float x2;
float y2;
float s2=0.5;
float x3;
float y3;
float s3=1.0;
float video_x1;
float video_y1;
float video_s1=0.5;
float video_x2;
float video_y2;
float video_s2=0.7;
float video_x3;
float video_y3;
float video_s3=0.8;
void setup(){
size(600,400,P2D);
video1 = new Capture(this,400,300);
video2 = new Capture(this,400,300);
video3 = new Capture(this,400,300);
imageMode(CENTER);
rectMode(CENTER);
stroke(1);
strokeWeight(6);
smooth();
}
void draw(){
background(255,123,22);
if(video1.available()){
video1.read();
}
if(video2.available()){
video2.read();
}
if(video3.available()){
video3.read();
}
//rect1
if(x1>600){
x1=0;
y1=random(0,height);}
x1=x1+s1;
fill(255,0,0);
rect(x1,y1,200,150);
//rect2
if(x2>600){
x2=0;
y2=random(0,height);}
x2=x2+s2;
fill(0,255,0);
rect(x2,y2,200,150);
//rect3
if(x3>600){
x3=0;
y3=random(0,height);}
x3=x3+s3;
fill(0,0,255);
rect(x3,y3,200,150);
//video1
if(video_x1>600){
video_x1=0;
video_y1=random(0,height);}
video_x1=video_x1+video_s1;
image(video1,video_x1,video_y1,200,150);
//video2
if(video_x2>600){
video_x2=0;
video_y2=random(0,height);}
video_x2=video_x2+video_s2;
image(video2,video_x2,video_y2,240,180);
//video3
if(video_x3>600){
video_x3=0;
video_y3=random(0,height);}
video_x3=video_x3+video_s3;
image(video3,video_x3,video_y3,280,210);
}