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

about   accomplish   activating   addition   adjust   adjusted   all   allowing   along   alternative   and   animations   answers   Anyway   appear   appropriate   appropriately   around   arrow   at   back   be   Before   behind   being   bit   blue   buffer   buffers   but   by   call   calls   camera   can   case   chance   chooses   chose   classic   color   complete   components   construct   construction   Control   control   coordinates   correctly   correspond   created   cube   custom   decrement   depth   didn   direction   Display   does   double   dumb   during   each   enough   entire   etc   event   events   execution   faces   far   field   figure   final   fired   for   frames   front   fully   Func   function   functions   gets   give   gives   gl   glut   green   handle   he   helps   his   hope   hovering   How   how   idle   in   In   increment   index   Init   initialization   initializing   initially   instructs   into   just   Keyboard   keys   learn   lines   Loop   loop   made   main   Main   make   making   matrix   missing   mode   Mode   motion   my   necessary   notes   occur   of   on   options   or   oriented   Ortho   other   others   out   parameter   parameters   passed   perception   problems   processing   program   programmer   properly   questions   quite   range   red   rendering   required   Reshape   resize   respectively   responses   run   Ryan   ryanw1   scaled   scales   scene   scenes   set   sets   should   significant   smoother   smoothness   some   something   sometimes   special   specifies   specify   speed   spin   spinning   stay   structure   submission   sure   swapping   Technicolor   tell   that   The   the   then   they   thing   things   This   this   time   timeless   times   tiny   to   toggle   triangles   two   up   use   using   various   view   viewpoint   Viewport   wants   was   way   weird   What   what   when   where   which   while   why   wide   will   Williams   window   with   yellow   zoom   zooming  

    RyanWilliams/assignment1

Ryan Williams ryanw1

Before my responses to the questions, some notes on my program:

I chose to construct the timeless classic "Technicolor cube with two triangles hovering around it" for my program. The construction is initially spinning; the direction of this spin can be adjusted using the four arrow keys. In addition, the r, g, and b keys toggle the red, green, and blue (respectively) components of the triangles' color (initially (1, 1, 0) = yellow) and the i and o keys adjust zooming speed in and out of the scene. I hope this is something along the lines of what was required! I didn't quite have time to learn enough to figure out why the faces of the cube sometimes appear in front of others that they shouldn't and other weird depth-perception problems, but I'm sure it's just some dumb thing I'm missing.

Anyway, here are my answers to the questions:

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 using special functions that the programmer chooses: the DisplayFunc, ReshapeFunc, KeyboardFunc, etc., that are fired when significant events occur during the execution of the program, allowing the programmer to handle a wide range of events appropriately. This structure is all set up initially in the main() function, where the programmer, in addition to initializing the window, sets a custom-made function for each event he wants to handle, that then gets fired at the appropriate times during execution. The entire event-processing loop is set into motion by the final call to glutMainLoop();

2) What does the parameter to glutInitDisplayMode() specify?

The parameters to glutInitDisplayMode() give the programmer a chance to toggle various options about the way his code will be run. In my submission, activating the GLUT_RGBA bit specifies that the window be created in RGBA mode (the alternative being color index mode, as far as I can tell?) while the GLUT_DOUBLE bit instructs the program to use a double buffer for smoother rendering, which helps the smoothness of animations by rendering frames fully on a behind-the-scenes buffer and then swapping buffers when the rendering is complete.

3) What do the calls to glOrtho() and glViewport() accomplish?

glOrtho() gives a matrix that scales the viewpoint of the camera, in this case making sure things stay oriented correctly in the event of a resize. I also use it in the idleFunc (with a tiny increment or decrement) to zoom in and out. The glViewport() call specifies the coordinates that should correspond to the field of view of the window, also necessary to make sure things appear properly scaled in the event of a resize.

Recent