2016年9月26日 星期一

Week 04 魏珩


作業一:

1.先做出一個圓,中間有一個點
void setup(){
 size(600,600);

}
void draw(){
  background(255);
  
      noFill();ellipse(200,200,40,40);
      fill(0); ellipse(200,200,8,8);
    
}











2.點會隨著圓圈繞












3.做出一排會繞圓的點











4.完成
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);
    } 
  }
  
}












5.讓點的移動像是波浪
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){
       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);
    } 
  }
  
}












作業二:播放聲音
1.要先添加模式(sound)
import processing.sound.*;
SoundFile file;
void setup(){
  size(500,500);
  file=new SoundFile(this,"PPAP.mp3");
  file.play();
}
void draw(){

}



作業三:播放影片


沒有留言:

張貼留言