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

ability   accomplish   actual   and   appropriate   Assignment   at   back   Bauman   be   buffering   button   by   call   called   calls   can   case   Category   color   continue   Control   control   coordinate   coordinates   Daniel   dbauman   determines   Display   display   does   double   during   During   edu   Enter   Func   function   functions   give   giving   gl   glut   How   how   If   in   In   including   Init   initialization   Keyboard   Mail   main   meaning   means   methods   might   Mode   modes   my   of   Once   onscreen   or   Ortho   orthographic   Page   parameter   parameters   part   passed   perspective   pertains   press   program   programmer   repeatedly   Reshape   reshape   resize   resized   run   S148   scheme   set   shapes   specific   specified   specifies   specify   stanford   system   take   that   The   the   them   then   these   they   this   through   time   to   To   up   use   user   view   Viewport   want   wants   we   What   what   why   window   Writeup  

    DanielBauman

Daniel Bauman's CS148 Page

Email: <dbauman AT SPAMFREE stanford DOT edu>

Assignment 1:

NOTE: In my program, press the <Enter> button repeatedly to continue the program.

Writeup

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

Control is passed back by giving the programmer the ability to give call-back functions. During initialization, methods including glutDisplayFunc(), glutReshapeFunc(), and glutKeyboardFunc() take functions as parameters, and then call them at the appropriate time. Once they are called, the programmer's code is run.

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

It specifies any display modes that the user wants. In this case, the GLUT_RGBA means that specific color scheme, and the GLUT_DOUBLE means to use double buffering.

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?

The glOrtho() call specifies the orthographic view of the window - meaning how the coordinates are set up, and what perspective to use. The glViewport() determines what part of the coordinate system the actual window pertains to. If the window is resized, we might also want to resize (or might not want to resize) the shapes onscreen, and this can be specified through these methods.


CategoryHomepage

Recent