第一題
第二題
PImage img;
int x=20,y=20;
img = loadImage("https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjxLbVoS_gyNp0IgztNcvOHT7FoOabL8cLDGT9ub_o2gO3tK6SMoP8aZ0Xx56BRSJfUSuHi_utWybNFuIYvYFYDlqQHFawcW5ObGSweuh5M6_kjQxGuubofkOQj8dEBRVtaiwBD1F9UZ68k/s1600/que-significa-hello-kitty-2.jpg");
size(img.width+2*x,img.height+2*y);
background(0,255,255);
image(img,x,y);
原圖
第三題
程式碼 部分 :
PImage img;
size(500,400);
img = loadImage("05.jpg");
image(img, 0, 0);
float t=HALF_PI/3;
translate(-250,-100);
scale(2, 2);
pushMatrix();
noStroke();
//披風
fill(0);
quad(200, 120, 150, 250, 350, 250,300, 120);
//身體
fill(220,220,0);
rect(280, 130, 30, 30,3);
fill(220,220,0);
rect(190, 130, 30, 30,3);
fill(255,0,0);
rect(205, 130, 90, 90,3);
//腰帶
fill(220,220,0);
rect(205, 180, 90, 20,3);
fill(255);
rect(235, 180, 35, 20,3);
fill(220,220,0);
rect(242, 185, 20, 10,3);
//小臉
ellipse(250,163,20,20);
//臉
fill(205,151,113);
ellipse(250,100,110,100);
//eyes
fill(0);
ellipse(235,85,10,20);
ellipse(265,85,10,20);
//鼻子
fill(255,0,0);
ellipse(250,110,40,30);
fill(220,103,80);
ellipse(220,110,20,30);
ellipse(280,110,20,30);
fill(255);
rect(245, 105, 10, 10,3);
//嘴巴
noFill();
stroke(0);
arc(250, 120, 50, 30, t, t*5);
//眉毛
arc(232, 80, 30, 35, t*6, PI*2);
arc(268, 80, 30, 35, t*6, PI*2);
//foot
noStroke();
fill(220,220,0);
rect(205, 220, 40, 20,3);
rect(255, 220, 40, 20,3);
popMatrix();
[心得]
在這堂課可以很容易的上手,因為很多程式碼和上學期學的OPNEGL很像。
也可以 感受到高階程式的功能 不用宣告可以直接就開始執行程式
很方便
processing 是一個很輕鬆上手的軟體 。