2010年6月24日 星期四

B9610119_Final





期末組合還是寫不完整所以先將單一物件上傳,老師不好意思。 

2010年6月20日 星期日

2010年6月14日 星期一

HW4. (final) Abstract Machine

HW4. (with processing)
Define several machine elements.
Compose abstract machine with these elements.
Deadline:
2010/6/21 pm 2:00

2010年6月7日 星期一

machine activation sample codes

wheel object1;
wheel2 object2;
int state = 0;
void setup()
{
size(640, 360);
background(255);
smooth();
object1 = new wheel(100, 100);
object2 = new wheel2(300, 100);

}
void draw()
{
if ((mousePressed) && (mouseX> width/2))
{
state= 1;
object1.input();
}
if (state ==1)
{
object1.update();
object1.display();
}
if (state == 2)
{

object2.update();
object2.display();
}


}



class wheel
{
int x, y;
float angle;
int nRotate;

wheel(int xc, int yc)
{
x= xc;
y= yc;
angle = 0;


}

void input()
{
nRotate= 0;
}
void update()
{
nRotate ++;
angle= angle + 10;
if (nRotate >50)
output();
display();


}

void display()
{
pushMatrix();
translate(x, y);
rotate(radians(angle));
rect(-10, -10, 20, 20);

popMatrix();

}
void output()
{
state = 2;
object2.input();
}


}
class wheel2
{
int x, y;
float angle;
int nRotate;

wheel2(int xc, int yc)
{
x= xc;
y= yc;
angle = 0;


}

void input()
{
nRotate= 0;
}
void update()
{
nRotate ++;
angle= angle + 10;
if (nRotate >50)
output();
display();


}

void display()
{

pushMatrix();
translate(x, y);
rotate(radians(angle));
rect(-10, -10, 20, 20);

popMatrix();

}
void output()
{
state = 1;
object1.input();
}


}

HW3 B9610119



HW3 B9610131

HW3 B9610117



        

week 12. what is machine?

http://www.auger-loizeau.com/index.php?id=13
http://www.youtube.com/watch?v=dmmxVA5xhuo
http://www.youtube.com/watch?v=Z8yFAS2GQQ8

What is the role of Human?

HW3 B9530007



HW3 B9634007







HW3 B9634015