2.
3.
void setup(){ size(600,600); } void draw(){ fill(255,0,0); rect(mouseX,mouseY,100,100); }
void setup(){ size(600,600); frameRate(24); } float x=100,y=100; void draw(){ background(0,0,0); fill(255,255,0); ellipse(mouseX,mouseY,60,60); fill(255,0,0); ellipse(x,y,50,50); x=x*0.8 + mouseX*0.2; y=y*0.8 + mouseY*0.2; }
3.
由於禮拜二生理不適沒去上課,今天有請教蕭俊宇同學教導 目前進度還算跟上,對有些程式碼有一點小不懂就是
void setup(){ size(600,600); //frameRate(1); } float x=100,y=100; void draw(){ background(0,0,0); PImage img; img=loadImage("1.png"); image(img,mouseX-150,mouseY-100); PImage img2; img2=loadImage("3.png"); image(img2 ,x ,y); x=x*0.9 + mouseX*0.1; y=y*0.9 + mouseY*0.1;
}
void setup(){
size(600,600);
//frameRate(1);
}
float [] a = new float[10];
float [] b = new float[10];
float x=100,y=100;
void draw(){
background(0,0,0);
a[9]=mouseX+100;
b[9]=mouseY+100;
for(int i=0;i<9;i++){
PImage img3;
img3= loadImage("4.png");
image (img3,a[i]=a[i+1]+mouseX*0.1,b[i]=b[i+1]+mouseY*0.1);
//a[i]=a[i+1]+mouseX*0.1;
//b[i]=b[i+1]+mouseY*0.1;
}
PImage img;
img=loadImage("1.png");
image(img,mouseX-150,mouseY-100);
PImage img2;
img2=loadImage("3.png");
image(img2 ,x ,y);
x=x*0.9 + mouseX*0.1;
y=y*0.9 + mouseY*0.1;
}
void setup(){ size(600,600); } void draw(){ fill(0,0,0); ellipse(200,200,50,50); ellipse(400,200,50,50); fill(255,150,150); ellipse(mouseX,mouseY,60,60); }
void setup(){ size(600,600); } void mb(){ float t=HALF_PI/3; translate(-250,-100); scale(2, 2); pushMatrix(); noStroke(); //披風 fill(0); quad(200, 120, 150, 200, 350, 200,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(); } void draw(){ scale(0.5,0.5); translate(mouseX+100,mouseY); mb(); }
float sx = random(30); float [] x = new float[10]; float [] y = new float[10]; //float Rs = random(20); void setup(){ size(600,600); } void img(){ PImage img; img = loadImage("123.png"); image(img, mouseX-190,mouseY-120); } void ellipseS(){ noStroke(); x[9]=mouseX; y[9]=mouseY; for(int i=0;i<9;i++){ fill(255,255,0); ellipse(x[i],y[i],15,15); x[i]=x[i+1]; y[i]=y[i+1]; } } void draw(){ background(255); ellipseS(); img(); }
void setup(){ size(600,600); } void draw(){ //fill(255,255,255); // rect(100,100,100,100); PImage img; img = loadImage("456.jpg"); image(img,mouseX ,mouseY); }
void setup(){ size(600,600); //frameRate(1); } float x=100,y=100; void draw(){ background(255,255,255); PImage img; img = loadImage("456.jpg"); PImage img_dog; img_dog = loadImage("123.jpg"); image(img_dog,x,y); image(img,mouseX ,mouseY); x=x*0.8 + mouseX*0.1; y=y*0.8 + mouseY*0.1; }剛開始覺得算輕鬆,但感覺越來越複雜了,希望老師能稍微獎的再詳細一點!!
void setup(){ size(600,600); } void draw(){ fill(255,255,255); rect(100,100,100,100); fill(78,168,250); ellipse(mouseX,mouseY,04,20); } 2.3.心得
void setup(){size(600,600); } float x=100,y=100; void draw(){ background(100,150,200); fill(212,211,78); ellipse(mouseX,mouseY,100,100); translate(x,y); fill(255,255,255); ellipse(0,0,80,80); fill(0,0,0); ellipse(-15,-15,20,20); fill(0,0,0); ellipse(15,-15,20,20); fill(0,0,0); ellipse(0,+13,15,10); fill(255,255,255); ellipse(-15,-15,10,10); fill(255,255,255); ellipse(15,-15,10,10); fill(0,0,0); ellipse(-30,-45,35,35); fill(0,0,0); ellipse(+30,-45,35,35); x=x*0.9 + mouseX*0.1; y=y*0.9 + mouseY*0.1; }
就是方向感要很好才能算出什麼位子要畫什麼東西 ㄏㄏ
size(600,600); for (int i=0;i<50 data-blogger-escaped-i="i" data-blogger-escaped-nbsp="nbsp" data-blogger-escaped-span="span" style="color: #cc6600;">fill(random(255),random(255),random(255)); rect(random(400),random(300),random(200),random(100)); }
size(500,400); noStroke(); for (int i=0;i<50 data-blogger-escaped-i="i" data-blogger-escaped-nbsp="nbsp" data-blogger-escaped-span="span" style="color: #cc6600;">for(int j=0;j<40 data-blogger-escaped-j="j" data-blogger-escaped-nbsp="nbsp" data-blogger-escaped-span="span" style="color: #cc6600;">fill(i*255/50+100,j*200/40+10,180); ellipse(i*10,j*20,30,40); } }
background(20,40,800); size(400,400); noStroke(); for( int i=0;i<8 data-blogger-escaped-i="i" data-blogger-escaped-nbsp="nbsp" data-blogger-escaped-span="span" style="color: #cc6600;">for( int k=0;k<6 data-blogger-escaped-k="k" data-blogger-escaped-span="span" style="color: #cc6600;">fill(i*255/2,k*255/4,0); ellipse(i*100+50,k*100+50,100,100); fill(i*255/7,k*255/8,255); ellipse(i*100+50,k*100+50,100,50); fill(i*255/9,k*255/25,0); ellipse(i*100+50,k*100+50,50,50); }}
void setup() { size(600,600); } //float x=100.0,y=100.0; void draw() { background(0,0,0); fill(255,255,0); ellipse(100,100,100,60); fill(255,0,255); ellipse(mouseX,mouseY,50,100); fill(255,0,255); ellipse(mouseX,mouseY,80,60); //x=x*0.9+mouseX*0.1; //y=y*0.9+mouseY*0.1; }
void setup()
{ size(600,600); } float x=100.0,y=100.0; void draw() { background(0,0,0); fill(255,255,0); ellipse(x,y,100,60); fill(255,0,255); ellipse(mouseX,mouseY,50,100); fill(255,0,255); ellipse(mouseX,mouseY,80,60); x=x*0.9+mouseX*0.1; y=y*0.9+mouseY*0.1; }
第一次上課吸收太多,要消化一下,不過跟Open gl有點像。
void setup(){ size(500,500); background(40,134,210); } void draw(){ noStroke(); fill(255,255,255); ellipse(mouseX,mouseY,50,50); //head fill(255,157,206); ellipse(mouseX+15,mouseY-45,20,50); //ear fill(255,157,206); ellipse(mouseX-15,mouseY-45,20,50); //ear fill(72,0,0); ellipse(mouseX-10,mouseY-5,10,10); //eye fill(72,0,0); ellipse(mouseX+10,mouseY-5,10,10); //eye fill(252,99,152); ellipse(mouseX+2,mouseY+15,25,20); //nose fill(72,0,0); ellipse(mouseX+2,mouseY+10,10,5); //nose }
2.兔子追著紅蘿蔔跑跑
void setup(){ size(600,600); } float x=100,y=100; void draw(){ background(40,134,210); noStroke(); fill(105,210,0); triangle(mouseX+69,mouseY+39,mouseX+82,mouseY+70,mouseX+97,mouseY+62); triangle(mouseX+95,mouseY+64,mouseX+111,mouseY+67,mouseX+103,mouseY+21); triangle(mouseX+109,mouseY+70,mouseX+119,mouseY+82,mouseX+135,mouseY+31); fill(255,60,60); ellipse(mouseX+100,mouseY+100,50,80); fill(128,0,0); rect(mouseX+76,mouseY+85,30,5); rect(mouseX+75,mouseY+105,25,5); rect(mouseX+82,mouseY+124,15,5); translate(x,y); fill(255,255,255); ellipse(0,0,50,50); //head fill(255,157,206); ellipse(+15,-45,20,50); //ear fill(255,157,206); ellipse(-15,-45,20,50); //ear fill(72,0,0); ellipse(-10,-5,10,10); //eye fill(72,0,0); ellipse(+10,-5,10,10); //eye fill(252,99,152); ellipse(+2,+15,25,20); //nose fill(72,0,0); ellipse(+2,+10,10,5); //nose x=x*0.9 + mouseX*0.1; y=y*0.9 + mouseY*0.1; }
3.心得
今天的作品利用短短的程式就可以跟著滑鼠移動,我覺得很有趣很好玩:D
void setup(){ size(600,600); } void draw(){ fill(255,255,255); rect(100,100,100,100); fill(255,168,178); ellipse(mouseX,mouseY,100,80); fill(0,0,0); ellipse(mouseX-15,mouseY-15,5,10); fill(0,0,0); ellipse(mouseX+15,mouseY-15,5,10); fill(0,0,0); ellipse(mouseX,mouseY+25,30,20); fill(255,168,178); ellipse(mouseX,mouseY+25,25,15); fill(0,0,0); ellipse(mouseX-5,mouseY+25,3,6); fill(0,0,0); ellipse(mouseX+5,mouseY+25,3,6); fill(255,168,178); ellipse(mouseX+30,mouseY-48,10,30); fill(255,168,178); ellipse(mouseX-30,mouseY-48,10,30); }
作業2
void setup(){ size(600,600); //frameRate(1); } float x=100,y=100; void draw(){ background(0,0,0); fill(123,72,38); ellipse(mouseX-5,mouseY-50,8,20); fill(123,72,38); ellipse(mouseX,mouseY-45,50,10); fill(123,72,38); ellipse(mouseX,mouseY-40,65,10); fill(123,72,38); ellipse(mouseX,mouseY-35,80,10); fill(123,72,38); ellipse(mouseX,mouseY-28,90,15); translate(x,y); fill(255,168,178); ellipse(0,0,100,80); fill(0,0,0); ellipse(-15,-15,5,10); fill(0,0,0); ellipse(+15,-15,5,10); fill(0,0,0); ellipse(0,+25,30,20); fill(255,168,178); ellipse(0,+25,25,15); fill(0,0,0); ellipse(-5,+25,3,6); fill(0,0,0); ellipse(+5,+25,3,6); fill(255,168,178); ellipse(+30,-48,10,30); fill(255,168,178); ellipse(-30,-48,10,30); x=x*0.9 + mouseX*0.1; y=y*0.9 + mouseY*0.1; }作業3 心得:這次對於畫圖的技巧感覺更熟練了!
void setup(){ size(600,600); background(166,255,255); } void draw(){ fill(0,0,0); rect(mouseX-5,mouseY,10,10); rect(mouseX+5,mouseY,10,10); fill(128,128,128); ellipse(mouseX,mouseY,50,50); fill(128,128,150); ellipse(mouseX+30,mouseY-20,30,30); fill(128,128,150); ellipse(mouseX-30,mouseY-20,30,30); fill(0,0,0); ellipse(mouseX-10,mouseY-10,10,10); fill(0,0,0); ellipse(mouseX+10,mouseY-10,10,10); fill(255,255,255); rect(mouseX-2,mouseY+10,5,7); rect(mouseX+2,mouseY+10,5,7); }2.
void setup(){ size(600,600); //frameRate(1); } float x=100,y=100; void draw(){ background(25,225,30); fill(255,255,38); ellipse(mouseX+5,mouseY+30,10,50); ellipse(mouseX+12,mouseY+30,10,50); ellipse(mouseX+19,mouseY+30,10,50); ellipse(mouseX+26,mouseY+30,10,50); ellipse(mouseX+33,mouseY+30,10,50); ellipse(mouseX+40,mouseY+30,10,50); ellipse(mouseX+47,mouseY+30,10,50); fill(64,0,0); rect(mouseX,mouseY,50,10); translate(x,y); fill(128,128,128); ellipse(0,0,50,50); fill(128,128,150); ellipse(+30,-20,30,30); fill(128,128,150); ellipse(-30,-20,30,30); fill(0,0,0); ellipse(-10,-10,10,10); fill(0,0,0); ellipse(+10,-10,10,10); fill(255,255,255); rect(-2,+10,5,7); rect(+2,+10,5,7); x=x*0.9 + mouseX*0.1; y=y*0.9 + mouseY*0.1; }
心得 今天得更有趣了,有漸漸感受到互動技術的厲害了,不過我還需要加強繪圖技術,如此一來
學到更多更新的互動技術,也不至於徬徨,更能發揮得當!