2025年4月24日 星期四

week10

作業1:想要做出一個可以轉動關節的人

//week10-1_postman

//頭、身體、手臂、手肘

size(560,560);

PImage postman=loadImage("postman.png");

PImage head=loadImage("head.png");

PImage body=loadImage("body.png");

background(#FFFFF2);

image(postman,0,0);

fill(255,0,255,128);

rect(0,0,560,560);

image(head,0,0);

image(body,0,0);



作業2:先讓頭可以轉動

//week10-2_postman

//頭、身體、手臂、手肘

PImage postman,head,body;

void setup(){

  size(560,560);

  postman=loadImage("postman.png");

  head=loadImage("head.png");

  body=loadImage("body.png");

}

void draw(){

  background(#FFFFF2);

  image(postman,0,0);///基礎全身郵差

  fill(255,0,255,128);//半透明的紫色

  rect(0,0,560,560);//蓋上去

  pushMatrix();

    translate(+232,+200);

    rotate(radians(mouseX));

    translate(-232,-200);

    image(head,0,0);

  popMatrix();

  image(body,0,0);

}

作業3:

作業4:

作業5:

沒有留言:

張貼留言