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

accomodate   accomplish   according   accumulation   an   and   arguments   Assignment   associated   axes   back   be   bitwise   bottom   buffer   buffered   buffering   by   calculating   callback   called   calling   calls   can   Cartesian   color   configurations   contents   control   coordinate   coordinates   corner   correspond   depth   Display   does   double   dragged   drawn   during   During   edges   Edward   example   examples   far   Finally   For   for   Func   function   functions   gl   glut   height   How   how   If   image   in   In   including   index   indicate   Init   initialization   initializes   inputs   int   invoked   keyboard   Keyboard   labelled   last   Ldouble   left   Lint   lower   Lsizei   main   managing   matrix   might   Mode   model   Motion   Mouse   mouse   multisampling   near   need   negative   new   next   of   on   operators   or   Ortho   other   parameter   parameters   part   pass   passed   pointer   positive   program   programmer   projection   Questions   range   redisplayed   render   rendering   Reshape   reshape   resized   resizing   respectively   responsible   right   routines   screen   separated   set   sets   single   six   size   sorting   specifies   specify   state   stencil   Suh   system   take   takes   that   The   the   There   These   They   this   to   top   two   unsigned   up   use   used   variables   variety   various   via   viewport   Viewport   want   we   What   what   when   whenever   whether   which   why   width   will   window   with  

    EdwardSuh/AssignmentOneQuestions

Edward Suh Assignment 1 Questions


1. In a GLUT program, how is control passed back to the programmer? How is this set up during initialization?
In a GLUT program, callback functions are used to pass control back to the programmer. During initialization, the glutDisplayFunc() is passed a function pointer that is called whenever the contents of the window need to be redisplayed. There are other examples of GLUT routines that take callback functions, including glutReshapeFunc(), which is responsible for resizing the window, glutKeyboardFunc() and glutMouseFunc(), which are responsible for managing keyboard and mouse inputs, respectively, and glutMotionFunc(), which is invoked when the mouse is dragged.

2. What does the parameter to glutInitDisplayMode() in main() specify?
glutInitDisplayMode() takes an unsigned int as a parameter, which can specify a variety of configurations. First, the parameter specifies whether to use an RGBA or color-index color model. The parameter can also specify whether to use a single or double-buffered window. Finally, it can indicate for the window to have an associated depth, stencil, multisampling, and/or accumulation buffer. These various configurations are passed via GLUT state variables separated by bitwise OR operators. For example, calling glutInitDisplayMode(GLUT_DOUBLE | GLUT_RGB | GLUT_DEPTH) initializes a window with double buffering, the RGBA color model, and a depth buffer.

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?
glViewport() specifies what part of the window to render to. It takes four arguments. The first two GLint's specify the coordinates of the lower left corner of the viewport. The next two GLsizei's specify the width and height of the viewport. glOrtho() sets the coordinate system of the image that is drawn on the screen by calculating a projection matrix. The function takes six GLdouble's as parameters. The first two specify the coordinates of the left and right edges of the rendering, respectively. The next two specify the bottom and top edges, respectively. The last two specify a range of Z-coordinates, which are used for depth-sorting. They are labelled 'near' and 'far', to correspond to the positive and negative Z-axes in Cartesian coordinates.
If a window is resized, the coordinate system may have to change to accomodate the new size of the window. The width and height parameters that are passed to glViewport(), for example, will have to change according to the new size of the window.

Recent