2017年1月12日 星期四

20170112 小楓兒筆記

*gopro頭戴攝影機

360度攝影機用遙控的和腳架可以減少手被拍攝到


維冠大樓3D模型
https://sketchfab.com/models/e1afea999b534dd6bcc1fde663f3e7ed

Microsoft HoloLens: Galaxy Explorer Ep. 6 - Coming to Life
https://www.youtube.com/watch?v=sMuJFKbylY4


*實作:小精靈

小精靈遊戲
https://www.google.com.tw/search?q=pacman&oq=pacman&aqs=chrome..69i57.4102j0j7&sourceid=chrome&ie=UTF-8#clb=clb

Target: Pacman
1. Play It
2. draw pacman
3. move pacman
4. draw map





// Map editor version 0.1
int [][]map={
  {7, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 9}, 
  {4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4}, 
  {4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4}, 
  {4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4}, 
  {4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4}, 
  {1, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 3}};
PImage [] img=new PImage[10];
void setup() {
  size(800, 300);
  for (int i=0; i<=9; i++) img[i]=loadImage(i + ".png");
}
int S=50;
int mouth=30;//45
int pacX=250, pacY=150, pacDir=0;//0,90,180,270
void draw() {
  background(255);
  for (int y=0; y<6; y++) {
    for (int x=0; x<16; x++) {
      image(img[ map[y][x] ], x*S, y*S, S, S);
    }
  }
  fill(#F7E007);
  //ellipse(250,150, S,S);
  arc(pacX, pacY, S, S, radians(mouth+pacDir), radians(360-mouth+pacDir), PIE);
  mouth=abs((frameCount*3)%90-45);
  //frameCount:0,1,2,3,...,45,...100000
  //frameCount%90:0,1,2,3,...,90, 0,1,2,...90,0
  //frameCount%90-45:-45,-44,-43,-42,..., 0,1,2,...,45,-45,-44,-43,...,45,-45
  //abs(frameCount%90-45):45,44,43,..., 0...1,2,...45,45,44...

  int editorX=int(mouseX/S), editorY=int(mouseY/S);
  fill(255, 0, 0); 
  rect(editorX*S, editorY*S, S, S);
}
void keyPressed() {
  if (keyCode==RIGHT) {pacX+=10; pacDir=0;}
  if (keyCode==DOWN) {pacY +=10; pacDir=90;}
  if (keyCode==LEFT) {pacX-=10; pacDir=180;}
  if (keyCode==UP) {pacY -=10; pacDir=270;}
}
void mouseDragged() {
  int editorX=int(mouseX/S), editorY=int(mouseY/S);
  float dx=mouseX-pmouseX, dy=mouseY-pmouseY;
  if (abs(dx)> 2*abs(dy)) map[editorY][editorX]=8;
  if (abs(dy)> 2*abs(dx)) map[editorY][editorX]=4;
}





沒有留言:

張貼留言