+ All Categories
Home > Documents > W4840 Embedded System Design Final Projectsedwards/classes/2014/4840/reports/Penrose... · Penrose...

W4840 Embedded System Design Final Projectsedwards/classes/2014/4840/reports/Penrose... · Penrose...

Date post: 06-Mar-2018
Category:
Upload: donga
View: 221 times
Download: 3 times
Share this document with a friend
37
Penrose World W4840 Embedded System Design Final Project Cong ZHU Yuanhui LUO Yao LUO Columbia University
Transcript
Page 1: W4840 Embedded System Design Final Projectsedwards/classes/2014/4840/reports/Penrose... · Penrose World W4840 Embedded System Design Final Project Cong%ZHU% Yuanhui%LUO% Yao%LUO

Penrose World W4840 Embedded System Design

Final Project

Cong  ZHU  Yuanhui  LUO  Yao  LUO

Columbia  University  

Page 2: W4840 Embedded System Design Final Projectsedwards/classes/2014/4840/reports/Penrose... · Penrose World W4840 Embedded System Design Final Project Cong%ZHU% Yuanhui%LUO% Yao%LUO

Basic idea

Page 3: W4840 Embedded System Design Final Projectsedwards/classes/2014/4840/reports/Penrose... · Penrose World W4840 Embedded System Design Final Project Cong%ZHU% Yuanhui%LUO% Yao%LUO

Ray-Casting Algorithm

• Basic  module  • Rota=on  Calcula=on

Page 4: W4840 Embedded System Design Final Projectsedwards/classes/2014/4840/reports/Penrose... · Penrose World W4840 Embedded System Design Final Project Cong%ZHU% Yuanhui%LUO% Yao%LUO

Ray-Casting Algorithm

• Original  Version  

Page 5: W4840 Embedded System Design Final Projectsedwards/classes/2014/4840/reports/Penrose... · Penrose World W4840 Embedded System Design Final Project Cong%ZHU% Yuanhui%LUO% Yao%LUO

Ray-Casting Algorithm

• Revised  Version  

Page 6: W4840 Embedded System Design Final Projectsedwards/classes/2014/4840/reports/Penrose... · Penrose World W4840 Embedded System Design Final Project Cong%ZHU% Yuanhui%LUO% Yao%LUO

Ray-Casting Algorithm

• Projec=on  onto  the  Screen  

Page 7: W4840 Embedded System Design Final Projectsedwards/classes/2014/4840/reports/Penrose... · Penrose World W4840 Embedded System Design Final Project Cong%ZHU% Yuanhui%LUO% Yao%LUO

System Architecture

Page 8: W4840 Embedded System Design Final Projectsedwards/classes/2014/4840/reports/Penrose... · Penrose World W4840 Embedded System Design Final Project Cong%ZHU% Yuanhui%LUO% Yao%LUO

HSP/FPGA

• HPS:  925  MHz,  dual-­‐core  ARM®  Cortex™-­‐A9  MPCore™  processor  •  FPGA:  Cyclone  V  SoC  5CSXFC6D6F31  Device  •  Interface:  ARM  AMBA®  AXITM  bus  bridges  • Usage:  Use  C-­‐generated  codes  to  control  FPGA  and  other  peripherals  such  as  Gamepad.

Page 9: W4840 Embedded System Design Final Projectsedwards/classes/2014/4840/reports/Penrose... · Penrose World W4840 Embedded System Design Final Project Cong%ZHU% Yuanhui%LUO% Yao%LUO

VGA

• Doing  projec=on  of  the  object  • Plot  2D  image  of  the  Objects  with  respect  of  the  loca=on  of  3D  objects.

Page 10: W4840 Embedded System Design Final Projectsedwards/classes/2014/4840/reports/Penrose... · Penrose World W4840 Embedded System Design Final Project Cong%ZHU% Yuanhui%LUO% Yao%LUO

Gamepad

• Control  the  rota=on  angle  when  playing.  • Control  the  loca=on  of  cubes  when  forming  map  • Other  control  func=ons  (speed  up,  fast  turn,  etc)

Page 11: W4840 Embedded System Design Final Projectsedwards/classes/2014/4840/reports/Penrose... · Penrose World W4840 Embedded System Design Final Project Cong%ZHU% Yuanhui%LUO% Yao%LUO

Memory

•  Store  Sin/Cos  look  up  table  • Buffer  projec=on  informa=on  of  cubes  •  Store  images  used  in  the  game

Page 12: W4840 Embedded System Design Final Projectsedwards/classes/2014/4840/reports/Penrose... · Penrose World W4840 Embedded System Design Final Project Cong%ZHU% Yuanhui%LUO% Yao%LUO

Hardware implementation

• Accelera=on  by  using  parallel  cas=ng  •  Tradeoff  between  resolu=on  and  refresh  rate  • Ping  pang  frame  buffer  •  Separate  one  object  into  four  part  

Page 13: W4840 Embedded System Design Final Projectsedwards/classes/2014/4840/reports/Penrose... · Penrose World W4840 Embedded System Design Final Project Cong%ZHU% Yuanhui%LUO% Yao%LUO

Acceleration by using parallel casting

Page 14: W4840 Embedded System Design Final Projectsedwards/classes/2014/4840/reports/Penrose... · Penrose World W4840 Embedded System Design Final Project Cong%ZHU% Yuanhui%LUO% Yao%LUO

Acceleration by using parallel casting

Page 15: W4840 Embedded System Design Final Projectsedwards/classes/2014/4840/reports/Penrose... · Penrose World W4840 Embedded System Design Final Project Cong%ZHU% Yuanhui%LUO% Yao%LUO

Acceleration by using parallel casting

Page 16: W4840 Embedded System Design Final Projectsedwards/classes/2014/4840/reports/Penrose... · Penrose World W4840 Embedded System Design Final Project Cong%ZHU% Yuanhui%LUO% Yao%LUO

Acceleration by using parallel casting

Page 17: W4840 Embedded System Design Final Projectsedwards/classes/2014/4840/reports/Penrose... · Penrose World W4840 Embedded System Design Final Project Cong%ZHU% Yuanhui%LUO% Yao%LUO

Acceleration by using parallel casting

Page 18: W4840 Embedded System Design Final Projectsedwards/classes/2014/4840/reports/Penrose... · Penrose World W4840 Embedded System Design Final Project Cong%ZHU% Yuanhui%LUO% Yao%LUO

Acceleration by using parallel casting

Page 19: W4840 Embedded System Design Final Projectsedwards/classes/2014/4840/reports/Penrose... · Penrose World W4840 Embedded System Design Final Project Cong%ZHU% Yuanhui%LUO% Yao%LUO

Acceleration by using parallel casting

Page 20: W4840 Embedded System Design Final Projectsedwards/classes/2014/4840/reports/Penrose... · Penrose World W4840 Embedded System Design Final Project Cong%ZHU% Yuanhui%LUO% Yao%LUO

Acceleration by using parallel casting

Page 21: W4840 Embedded System Design Final Projectsedwards/classes/2014/4840/reports/Penrose... · Penrose World W4840 Embedded System Design Final Project Cong%ZHU% Yuanhui%LUO% Yao%LUO

Acceleration by using parallel casting

Page 22: W4840 Embedded System Design Final Projectsedwards/classes/2014/4840/reports/Penrose... · Penrose World W4840 Embedded System Design Final Project Cong%ZHU% Yuanhui%LUO% Yao%LUO

Acceleration by using parallel casting

Page 23: W4840 Embedded System Design Final Projectsedwards/classes/2014/4840/reports/Penrose... · Penrose World W4840 Embedded System Design Final Project Cong%ZHU% Yuanhui%LUO% Yao%LUO

Acceleration by using parallel casting

Page 24: W4840 Embedded System Design Final Projectsedwards/classes/2014/4840/reports/Penrose... · Penrose World W4840 Embedded System Design Final Project Cong%ZHU% Yuanhui%LUO% Yao%LUO

Tradeoff between resolution and refresh rate

• N*N  -­‐>  (N/2)*(N/2)  • Pixels  need  to  be  calculated  -­‐>  1/4    • Depth  need  to  be  cast  -­‐>  1/2  •  Total  calcula=on  -­‐>  1/8  •  Scan  16  =mes  per  refresh  -­‐>  Scan  2  =mes  per  refresh    

Page 25: W4840 Embedded System Design Final Projectsedwards/classes/2014/4840/reports/Penrose... · Penrose World W4840 Embedded System Design Final Project Cong%ZHU% Yuanhui%LUO% Yao%LUO

Ping pang frame buffer

•  Frame  buffer  odd  &  Frame  buffer  even    • Read  from  Frame  buffer  odd  =>  write  to  Frame  buffer  even    • Read  from  Frame  buffer  even  =>  write  to  Frame  buffer  odd    

Page 26: W4840 Embedded System Design Final Projectsedwards/classes/2014/4840/reports/Penrose... · Penrose World W4840 Embedded System Design Final Project Cong%ZHU% Yuanhui%LUO% Yao%LUO

Separate one object into four part

•  That  is  an  illusion  • We  actually  have  four  objects,  but  each  one  only  show  1/4  surface  •  This  1/4  surface  is  dynamic  •  4  hollow  objects  can  be  merge  into  an  integrated  one  •  If  4  hollow  objects  have  different  colors,  the  integrated  one  looks  like  a  magic  cubic  

• Achieve  it  by  banking  the  calcula=on  of  object  surface  

Page 27: W4840 Embedded System Design Final Projectsedwards/classes/2014/4840/reports/Penrose... · Penrose World W4840 Embedded System Design Final Project Cong%ZHU% Yuanhui%LUO% Yao%LUO

Software in C

Page 28: W4840 Embedded System Design Final Projectsedwards/classes/2014/4840/reports/Penrose... · Penrose World W4840 Embedded System Design Final Project Cong%ZHU% Yuanhui%LUO% Yao%LUO

• What  so(ware  do  •  1.  read  signal  of  gamepad  from  USB  in  sohware,  and  transfers  informa=on  messages  to  hardware  

•  2.  calculate  rota=on  informa=on  of  space  •  3.  calculate  the  pass  situa=on  •  4.  control  the  movement  of  balls  •  5.  new  graph  crea=on  &  level  select

Page 29: W4840 Embedded System Design Final Projectsedwards/classes/2014/4840/reports/Penrose... · Penrose World W4840 Embedded System Design Final Project Cong%ZHU% Yuanhui%LUO% Yao%LUO

Part 1

1.  Press  down  key  of  gamepad,it  will  generate  different  signal.  Pass  it  to  hello.c    

2.  When  we  finish  each  computa=on  of  a  =me  slot,  we  will  transfer  computed  message  to  hardware  

Page 30: W4840 Embedded System Design Final Projectsedwards/classes/2014/4840/reports/Penrose... · Penrose World W4840 Embedded System Design Final Project Cong%ZHU% Yuanhui%LUO% Yao%LUO

Part 2

1.  Read  key  value  from  gamepad,  generate  the  opera=on  number,  which  will  change  rota=on  value  from  0  –  4095  for  x-­‐coordinate  and  y-­‐coordinate.  As  we  divide  360  degree  into  4096  parts.  We  will  send  number  from  0-­‐4095  to  hardware  once  it  changes.  

2.  More  func=on    control  the  rota=on  rate  

  complete  a  90  degree  rota=on  for  once

Page 31: W4840 Embedded System Design Final Projectsedwards/classes/2014/4840/reports/Penrose... · Penrose World W4840 Embedded System Design Final Project Cong%ZHU% Yuanhui%LUO% Yao%LUO

Part 3

Our  goal  is  to  decide  whether  two  cubic  can  connect  or  no  in  special  rota=on  angles  of  projec=on  plane.

Page 32: W4840 Embedded System Design Final Projectsedwards/classes/2014/4840/reports/Penrose... · Penrose World W4840 Embedded System Design Final Project Cong%ZHU% Yuanhui%LUO% Yao%LUO

Part 3

Invisible  cubic Ver=cal  to  projec=on  plane

Axle  wire

Our  view

Center  node  C  

Page 33: W4840 Embedded System Design Final Projectsedwards/classes/2014/4840/reports/Penrose... · Penrose World W4840 Embedded System Design Final Project Cong%ZHU% Yuanhui%LUO% Yao%LUO

implement:  Step1:  Record  the  vectors  from  nodes  on  axle  wire  to  all  center  nodes  on  other  cubic.(ini=al  step)  Step2:  As  in  our  algorithm,  we  change  the  rota=on  angles  of  screen,  so  we  only  need  to  change  the  Normal  vector  of  projec=on  plane.  Then  compare  it  to  every  pair  in  step1,  if  their  direc=on  are  same  in  same  degree.  The  two  cubic  are  connected.  

Part 3

Page 34: W4840 Embedded System Design Final Projectsedwards/classes/2014/4840/reports/Penrose... · Penrose World W4840 Embedded System Design Final Project Cong%ZHU% Yuanhui%LUO% Yao%LUO

1.  Ini=alize  balls  –  ini=alize_ball()  2.  Normal  opera=on  –  ball_moving()  3.  Decide  jump  node  -­‐  calculate_jump_point()  4.  Combine  two  ball  when  meet  –  combine()  5.  recovery    

Part 4

Page 35: W4840 Embedded System Design Final Projectsedwards/classes/2014/4840/reports/Penrose... · Penrose World W4840 Embedded System Design Final Project Cong%ZHU% Yuanhui%LUO% Yao%LUO

•  create  new  graph  •  Select  levels  

 

Part 5

Page 36: W4840 Embedded System Design Final Projectsedwards/classes/2014/4840/reports/Penrose... · Penrose World W4840 Embedded System Design Final Project Cong%ZHU% Yuanhui%LUO% Yao%LUO
Page 37: W4840 Embedded System Design Final Projectsedwards/classes/2014/4840/reports/Penrose... · Penrose World W4840 Embedded System Design Final Project Cong%ZHU% Yuanhui%LUO% Yao%LUO

Recommended