程式碼:
void setup(){
size(600,600);
}
void draw(){
float a=5*frameCount/180.0*3.1415;
background(255);
for(int x=0;x<=600;x+=40){
for(int y=0;y<=600;y+=40){
noFill();ellipse(x,y,40,40);
fill(0);ellipse(x+20*cos(a),y+20*sin(a),8,8);
}
}
}
void setup()
{
size(600,600);
}
void draw()
{
background(255);
for(int x=0;x<=600;x+=40)
{
for(int y=0;y<=600;y+=40)
{
float a=5*(frameCount+x/5+y/5)/180.0*3.1415;
noFill();
ellipse(x,y,40,40);
fill(0);
ellipse(x+20*cos(a),y+20*sin(a),8,8);
}
}
}
程式碼:
void setup()
{
size(600,600);
frameRate(60);
}
void draw()
{
background(255);
for(int i=0;i<11;i++)
{
for(int j=0;j<11;j++)
{
float t=(frameCount/6.0+i+j)*0.7189;
fill(0,0,0,0);
ellipse(i*51.5+5,j*51.5+5,45,45);
ellipse(i*51.5+30,j*51.5+5,45,45);
ellipse(i*51.5+5,j*51.5+30,45,45);
ellipse(i*51.5+30.5,j*51.5+30,45,45);
fill(0);
ellipse(i*51.5+22.5*cos(t),j*51.5+5+22.5*sin(t),5,5);
ellipse(i*51.5+30.5+22.5*cos(t),j*51.5+5+22.5*sin(t),5,5);
ellipse(i*51.5+5+22.5*cos(t),j*51.5+30.5+22.5*sin(t),5,5);
ellipse(i*51.5+30.5+22.5*cos(t),j*51.5+30.5+22.5*sin(t),5,5);
}
}
}
void keyPressed()
{
if(key==' ')frameRate(1);
}
播音樂匯入引用庫
程式碼:
import processing.sound.*;
SoundFile file;
void setup(){
size(500,500);
file=new SoundFile(this,"PPAP.mp3");
file.play();
}
void draw(){
}
匯入影片
匯入引用庫
程式碼:
import processing.sound.*;
import processing.video.*;
//SoundFile file;
Movie movie;
void setup(){
size(500,500);
//file=new SoundFile(this,"PPAP.mp3");
//file.play();
movie=new Movie(this,"PPAP.mp4");
movie.play();
}
void draw(){
image(movie,0,0,800,450);
}
void movieEvent(Movie m){
m.read();
}







沒有留言:
張貼留言