2012年10月2日 星期二

Week 04, HW04, 葉正聖老師示範

座位表:

https://docs.google.com/a/mail.mcu.edu.tw/spreadsheet/ccc?key=0AiYbu0zjxrp1dElYQkdOU3F5NWVFOUZFc0ZCRVRFR3c

proxy.tj.mcu.edu.tw   3128
void setup(){
  size(500,400);
}
void draw(){
  line(mouseX, mouseY, pmouseX, pmouseY);
}
================
void setup(){
  size(500,400);
}
void draw(){
  if(mousePressed)  line(mouseX, mouseY, pmouseX, pmouseY);
}

==================
void setup(){
  size(500,400);
  rect(0,0,50,50);
  rect(0,50,50,50);
}
void draw(){
  if(mousePressed && mouseX<50 && mouseY<50) stroke(255,0,0);
  else if(mousePressed && mouseX<50 && mouseY<100) stroke(0,255,0);
  else if(mousePressed)  line(mouseX, mouseY, pmouseX, pmouseY);
}

======================
void setup(){
  size(500,400);
  rect(0,0,50,50);
  rect(0,50,50,50);
  rect(0,100,50,50);
  rect(0,150,50,50);
  rect(450,0,50,50);
  rect(450,50,50,50);
}
int www=5;
void draw(){
  if(mousePressed && mouseX<50 && mouseY<50) stroke(255,0,0);
  else if(mousePressed && mouseX<50 && mouseY<100) stroke(0,255,0);
  else if(mousePressed && mouseX<50 && mouseY<150) save("aaaa.png");
  else if(mousePressed && mouseX<50 && mouseY<200){
    PImage file = loadImage("aaaa.png");
    image(file, 0,0,500,400);
 
  }else if(mousePressed && mouseX>450 && mouseY<50){
    strokeWeight(++www);
  }
  else if(mousePressed && mouseX>450 && mouseY<1000){
    strokeWeight(--www);
    if(www<2)www=2;
  }
  else if(mousePressed)  line(mouseX, mouseY, pmouseX, pmouseY);
}
=====
http://code.google.com/p/simple-openni/
http://learning.codasign.com/index.php?title=Build_Your_Own_Superhero

沒有留言:

張貼留言