proce55ing プログラミングアート全般at TECH
proce55ing プログラミングアート全般 - 暇つぶし2ch346:デフォルトの名無しさん
09/09/04 22:08:21
うまく巻き戻しのとこは消えないね
そもそもこのやり方ってビデオの再生が飛んだりProcessingが死んだりしない?
import processing.video.*;
Movie[] mov = new Movie[2];
int index, nextIndex;
float currentTime, changeTime;
void setup() {
size(640, 480, P2D); frameRate(15); background(0);
mov[0]=new Movie(this, "1.mov");
mov[1]=new Movie(this, "2.mov");
index = nextIndex = 0; changeTime = -1;
mov[0].loop();
}
void draw() {
image(mov[index], 0, 0, mov[index].width, mov[index].height);
currentTime = mov[index].time();
if (currentTime < changeTime && currentTime > 0.07) {
changeTime = -1;
mov[index].stop(); index = nextIndex; mov[index].loop();
}
}
void keyPressed() {
changeTime = mov[index].time();
noLoop(); mov[index].jump(0); redraw();
switch (key) {
case '1':
nextIndex = 0; break;
case '2':
nextIndex = 1; break;
}
loop();
}


次ページ
続きを表示
1を表示
最新レス表示
レスジャンプ
類似スレ一覧
スレッドの検索
話題のニュース
おまかせリスト
オプション
しおりを挟む
スレッドに書込
スレッドの一覧
暇つぶし2ch