2018年9月27日 星期四

WEEK3 04211021 馬紹芸

1. san jiao han shu


void setup(){
 size(500,500);
}
void draw(){
   ellipse(250,250, 480,480);      //480shi zhi jing
   for(float angle=0; angle<PI*2; angle+=PI/3){
     triangle(250,250,
             250+240*cos(angle), 250+240*sin(angle),
             250+240*cos(angle+PI/3),250+240*sin(angle+PI/3));
}
}



2.

void draw(){
   ellipse(250,250, 480,480);
   for(float angle=0; angle<PI*2; angle+=PI/3){
     for(int R=0; R<=240; R+=20){
       noFill();
       triangle(250,250,
             250+R*cos(angle),     250+R*sin(angle),
             250+R*cos(angle+PI/3),250+R*sin(angle+PI/3));
     }}
   }



3.
https://www.facebook.com/…/vb.10000008496…/1310952318917588/


4.
teacher:


mine


for(int R=15; R>0; R-=5){
    triangle( cx+R*cos(a), cy+R*sin(a),
             cx+R*cos(a+2*PI/3), cy+R*sin(a+2*PI/3),
             cx+R*cos(a-2*PI/3), cy+R*sin(a-2*PI/3));
  }
}
           
void draw(){
  background(255);
  for (int cx=20; cx<800; cx+=40) {
    for(int cy=20; cy<400; cy+=40) {
   //ellipse(cx,cy, 30,30);
   myTriangle(cx, cy);
     }
   }}



5.mario game(shang xia zuo you)




6.""newton}} VX=su du AX =jia su du(tan tiao gan)
teacher

mine

PImage imgMario;
float marioX=0, marioY=0, marioVX=2, marioVY=0, marioAX=0, marioAY=0.1;

void setup(){
  size(400, 600);
  imgMario= loadImage("mario.png");//Only Once!!
}

void draw(){
  //background(255);
  image(imgMario, marioX,marioY, 100,150);
  marioX += marioVX; marioY += marioVY;
  marioVX+= marioAX; marioVY+= marioAY;
//Don't load any image in draw()
}

void keyPressed(){
  if(keyCode==UP)   {marioY-=5;}
  if(keyCode==DOWN) {marioY+=5;}
  if(keyCode==LEFT) {marioX-=5;}
  if(keyCode==RIGHT){marioX+=5;}
}


7.http://www.cmlab.csie.ntu.edu.tw/…/process…/angryBirdsBrick/

沒有留言:

張貼留言