2012年12月2日 星期日
B10034002_黃健崴_聖誕樹
void setup() {
size(500, 400, P3D);
noFill();
}
void draw() {
background(0,172,33);
int a = 250;//x1
int b = 60; //y1
int c = 200;//x3 left
int d = 300;//x3 right
int q = int(map(mouseX, 520,0, 0, 30));
stroke(0,100,20);
bezierDetail(q);
for(int i=0; i<24; i=i+2){
bezier(a, b, a, b+20, c+i*5, 180-i, c-80+i*5, 180-i);
bezier(a, b, a, b+20, c+i*5, 220-i, c-90+i*5, 220-i);
bezier(a, b, a, b+20, c+i*5, 260-i, c-100+i*5, 260-i);
bezier(a, b, a, b+20, c+i*5, 330-i/2, c-20+i*5, 300-i/2);
bezier(a, b, a, b+20, d-i*5, 260-i, d+100-i*5, 260-i);
bezier(a, b, a, b+20, d-i*5, 220-i, d+90-i*5, 220-i);
bezier(a, b, a, b+20, d-i*5, 180-i, d+80-i*5, 180-i);
bezier(a, b, a, b+20, d-i*5, 330-i/2, d+20-i*5, 300-i/2);
}
}
2012年11月17日 星期六
b10034002 黃健崴 logo
Eye e1, e2, e3, e4;
void setup(){
size(300,300);
noStroke();
e1 = new Eye( 187, 149, 7);
e2 = new Eye( 132, 125, 14);
e3 = new Eye( 151, 149, 7);
e4 = new Eye( 179, 192, 4);
}
void draw(){
background(102);
PFont font; //delare the font
font=loadFont("DejaVuSans-Bold-48.vlw");
textFont(font);
fill(0);
textSize(40);
text("SPCIAL",53,140);
textSize(21);
text("INTERACTION",55,156);
textSize(38);
text("DESIGN",54,186);
textSize(8);
text("2012 @NTUST",148,195);
smooth();
e1.update(mouseX, mouseY);
e2.update(mouseX, mouseY);
e3.update(mouseX, mouseY);
e4.update(mouseX, mouseY);
e1.display();
e2.display();
e3.display();
e4.display();
}
class Eye
{
int ex, ey;
int size;
float angle = 0.0;
Eye(int x, int y, int s) {
ex = x;
ey = y;
size = s;
}
void update(int mx, int my) {
angle = atan2(my-ey, mx-ex);
}
void display() {
pushMatrix();
translate(ex, ey);
fill(102);
ellipse(0, 0, size, size);
rotate(angle);
fill(0);
ellipse(size/4, 0, size/1.5, size/1.5);
popMatrix();
}
}
2012年10月19日 星期五
訂閱:
意見 (Atom)


