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

accomplish   an   and   Assignment   assumes   back   be   being   both   bounds   buffered   callback   calls   changes   color   control   coordinate   coordinates   defined   depth   Display   display   does   double   drawn   draws   during   During   every   farthest   for   from   Func   function   functions   gets   gl   glut   helps   How   how   If   image   in   In   index   Init   initialization   keyboard   Keyboard   Kong   lower   main   mapped   might   mode   Mode   model   nearest   normalized   of   Open   or   Ortho   parameter   parameters   passed   pointers   program   programmer   proportion   relative   reshape   resized   screen   second   set   single   specifies   specify   such   system   the   The   This   this   through   Thus   time   to   transformation   two   up   upper   use   user   Viewport   want   we   What   what   why   window   Writeup   Yeunjin  

    YeunjinKong/Assignment 1 Writeup

Yeunjin Kong/Assignment 1 Writeup

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

In a GLUT program, control is passed back to the programmer through callback functions. In Assignment 1, glutKeyboardFunc() is such function. During initialization, function pointers to user-defined functions are passed to callback functions as parameters. In Assignment 1, keyboard() is such function.

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

The parameters to glutInitDisplayMode() specify the display mode of the window, such as RGBA or color-index, or single-or double-buffered. The main function of Assignment 1 has two parameters. The first parameter GLUT_RGBA specifies to use an RGBA color model. The second parameter GLUT_DOUBLE specifies to use a double-buffered window.

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() specifies the coordinate system OpenGL assumes as it draws the image and how the image gets mapped to the screen. glViewport() specifies the transformation of x and y coordinates from normalized coordinates to window coordinates. Thus in main.cpp, every time the window is resized, the coordinate system is set to have 0 and 1 as the lower and upper bounds for both x and y coordinates, the nearest depth is set to 0 and the farthest depth is set to 1. This helps the relative proportion of what is being drawn changes as the window is resized.

Recent