MovieMaker 將processing 畫面錄製下來
原始碼:
// 錄製影片前注意事項 安裝quicktime 以及存檔
import processing.video.*;
MovieMaker mm;
void setup(){
size(1024,768);
background(0);
mm = new MovieMaker(this, width, height, "DEMO.mov",
30, MovieMaker.JPEG,MovieMaker.BEST);
frameRate(1000);
colorMode(HSB,100);
noStroke();
smooth();
}
float l=0;
float v=0;
float x=0;
float y=0;
void draw(){
fill(map(l,0,360,0,100),100,100);
y = width/2-100 + sin(radians(v))*100;
x = height/2-500 + cos(radians(v))*100;
l = (l >= 360) ? 0 : l+1;
v= l % 360;
mm.addFrame(); // 錄製影片注意處
translate(width/2,height/2);
rotate(radians(-l));
ellipse(x,y,x*0.5,x*0.5);
ellipse(y,y,x*0.5,x*0.5);
ellipse(y,x,x*0.5,x*0.5);
ellipse(x,x,x*0.5,x*0.5);
}
void keyPressed() {
if (key == ' ') {
mm.finish(); // 錄製影片注意處 按空白鍵 停止錄製
}
}
Simple mouse with box
沒有留言:
張貼留言