The following 184 words could not be found in the dictionary of 615 words (including 615 LocalSpellingWords) and are highlighted below:

according   action   Adam   along   an   and   animated   another   arbitrary   arrow   arrows   Assignment   associated   at   axes   be   below   bit   both   bottom   buffer   buffering   button   by   call   can   case   changes   chopped   circle   clock   Cohen   color   compile   control   coordinate   corresponds   default   define   defined   defines   depending   Describe   different   direction   Display   display   Double   double   drawn   draws   during   effect   Enjoy   entire   event   events   every   faces   few   field   flags   For   for   from   fun   Func   function   functions   given   gl   glut   go   goes   he   his   homeless   in   In   initialization   input   instaed   instance   just   keys   left   look   make   makes   Man   man   matrix   member   mode   mouth   movement   moves   moving   much   multiplies   must   net   new   number   occurs   of   on   onscreen   open   or   Ortho   orthoganal   other   out   Pac   Pacman   pacman   parameters   particular   path   pixels   point   program   programmer   Put   rectangle   rectangles   redrawn   reference   representing   run   screen   seconds   shut   simple   simply   Since   size   slice   smoothers   solid   spans   Special   specified   specifies   start   static   supposed   system   technique   that   The   the   There   this   This   tick   time   to   together   trigger   two   updates   upwards   User   variable   very   Viewport   viewport   way   we   well   When   when   where   which   width   will   window   with   With   Writeup   You   you  

    AdamCohen/Assignment 1 Writeup

Describe AdamCohen/Assignment 1 Writeup here.


This program is a homeless man's PacMan. When you run the program, pacman will start moving upwards along the path. You can control his movement with the arrow keys. It's a solid 8 seconds of fun. Enjoy.


Pacman is drawn with an open_circle function which draws a circle with a variable width 'slice' chopped out in an arbitrary direction. Pacman has a static _direction field associated with it. With every clock tick, he moves a bit in that direction. When he is drawn, the open slice also faces in that direction. The size of the slice is also a static member and changes with every tick to make his mouth go open and shut. The path is just a few rectangles.

User input is very simple. glutSpecialFunc(arrows) defines that the action of the arrow keys is to simply change pacman's direction field to 0, 90, 180, or 270, depending on the button.

1) There are a number of events which trigger event functions that are

  • specified by the programmer at compile-time. For instance, we define the display() function, which is supposed to run every time a display event occurs (when the screen must be redrawn). This is defined with a call to glutDisplayFunc( display ); during initialization.

2) In this case, it specifies that we are in RGBA mode as well

  • as double buffering mode. RGB is a particular way of representing color on the screen. Double buffering is a technique where the drawing buffer is different from the onscreen buffer, and it makes animated updates look much smoothers. There are a number of other flags that can be or'd together.

3) glOrtho(), according to man, multiplies the coordinate system

  • by an orthoganal matrix defined in the parameters. Since the default matrix is from -1 to 1 on both axes, the net effect is that the new coordinate system (below) goes from 0 to 100 instaed. glViewport() changes the reference point for the coordinate system. As I have it below, (0, 0) in the coordinate system corresponds to (0,0) in pixels (by first two parameters) and the 'end' of the coordinate system - in this case (100, 100) is given by (w, h) in pixels. Put another way, the viewport rectangle spans the entire window with coordinate (0,0) at the bottom left.