Android Graphics

29 downloads 249 Views 2MB Size Report
OpenGL ES APIs provided by the Android framework provide a set of tools for displaying high-‐end, animated graphics. • Benefit from the accelera6on of ...
Android  OpenGL  Graphics  

  Jay  Urbain,  Ph.D.   •  •  •  •  • 

Credits:     h  WORLD  COORDINATES  -­‐>>  VIEW   COORDINATES  -­‐>>  VIEWPORT  COORDINATES   •  Modeling  coordinates  define  the  coordinates  of  a  model   object.   •  Models  are  placed  within  an  object,  world,  model  or  problem   coordinate  space.   •  Viewing  specificaHons  usually  are  also  in  model  coordinates.   •  Eventually  3D  objects  in  model  space  are  projected  as  2D   pixels  in  window/screen  viewport  coordinates.    

23

Coordinate  Systems   •  Coordinate  systems  can  be  2D  or  3D.   •  We  treat  2D  as  a  degenerate  case  of  3D,  draw  on  single  plane.  

3D  Coordinate  Systems   •  3D  vertex  coordinates  are   wriwidth,  esContext-­‐>height);      void  glViewport(  GLint  x,GLint  y,GLsizei  width,GLsizei  height);   •  Define  view  volume.     •  gl.glFrustumf(-­‐raHo,  raHo,  -­‐1,  1,  3,  7);  //  apply  the  projecHon  matrix.                void  glFrustumf(GLfloat  le;,  GLfloat  right,  GLfloat  bo