补充上一节案例的粗糙粒子效果,视频动态定格。
input:
import processing.video.*;
Particle[] particles;
//PImage mount;
Capture mount;
void setup(){
size(600,445);
printArray(Capture.list()); //高分辨率获取
//mount = loadImage("xueshan600x445.jpg");
mount = new Capture(this,Capture.list()[0]); //调用第1事件,即多个摄像头之一捕获的事件
mount.start();
particles = new Particle[1000];
for (int i = 0;i < particles.length;i++){
particles[i] = new Particle();
}
background(0);
}
void captureEvent(Capture video){
video.read();
}
void draw(){
//background(0);
for (int i = 0;i < particles.length;i++){
particles[i].display();
particles[i].move();
}
}
output:
视频粒子动态定格