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

ability   accomplish   affect   allows   an   and   animation   back   be   bottom   box   buffer   buffers   by   callback   called   calls   case   color   Control   control   corner   creates   Display   display   does   don   double   during   During   edges   far   fix   for   front   Func   function   functions   gl   glut   height   How   how   If   in   In   indexing   Init   initialization   instead   key   keyboard   Keyboard   left   main   might   mode   Mode   near   of   one   Ortho   orthographic   parallel   parameter   passed   pointers   pressed   program   programmer   region   reshape   resized   resizing   right   set   sets   single   smooth   specified   specifies   specify   specifying   speficies   such   swap   The   the   then   this   through   to   top   unlikely   up   us   use   viewing   Viewport   volume   want   we   What   whenever   why   width   window   you  

    AndyGrant/Assignment1

1. In a GLUT program, how is control passed back to the programmer? How is this set up during initialization?

  • Control is passed back to the programmer through callback functions such as glutKeyboardFunc(). During initialization function pointers are passed to the callback functions. In this program whenever a key is pressed keyboard() is called as specified in main() by glutKeyboardFunc( keyboard ).

2. What does the parameter to glutInitDisplayMode() in main() specify?

  • The glutInitDisplayMode() in main() specifies the display mode for the window. In this case it is specifying to us RGBA (GLUT_RGBA) instead of color-indexing and to use a double buffer (GLUT_DOUBLE) instead of a single one. The double buffer allows for smooth animation (ability to swap front and back buffers).

3. What do the calls to glOrtho() and glViewport() in the reshape() function accomplish? If the window is to be resized, why might we want to change this?

  • glOrtho() creates an orthographic parallel viewing volume. It specifies the left, right, top, bottom, near and far edges of the box of the viewing volume. glViewport sets up the drawing region. it speficies the bottom left corner of the region and then height and width of the region. If the window is to be resized you don't want to fix the drawing region as the window resizing is unlikely to have an affect.
Recent