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

accomplish   accordingly   an   and   appropriate   around   Art   Assignment   at   axis   back   based   being   between   bits   bitwise   Blue   both   buffer   buffering   but   callbacks   called   calls   can   case   color   Computer   configured   constants   contains   Control   control   coordinate   coordinates   curve   different   Display   display   does   done   double   draw   drawable   drawn   draws   Dual   during   edu   en   enable   entire   equations   Esc   events   exit   finished   five   for   found   frame   framebuffer   framebuffers   from   Func   function   functions   Generative   gl   glut   go   graphic   graphics   Graphics   Green   How   how   Hypocycloid   hypocycloid   image   images   Imaging   in   In   Init   initialization   inside   instead   Instructor   int   Intro   Introduction   January   keypress   like   methods   Mode   model   modified   number   of   on   one   or   originally   Ortho   param   parameter   parameters   parametric   Park   park   passed   pentagon   performs   pointer   press   program   programmer   Question   Questions   re   reads   Red   redisplay   region   regularly   Reshape   reshape   resize   Resposne   ryan   Ryan   S148   says   scale   second   see   set   sets   shown   size   so   specified   specify   stanford   swapped   swaps   syas   system   take   than   that   The   the   then   there   these   This   this   those   through   to   To   Together   up   us   use   used   using   Viewport   we   were   What   When   when   which   while   Wikipedia   wikipedia   will   window   write   you  

    RyanPark/Assignment1

Assignment 1

Assignment 1: Generative Art

Ryan Park (ryan.a.park@stanford.edu)

CS148 (Intro to Computer Graphics and Imaging)

January 18, 2007

Introduction

This program draws five different images based around a set of hypocycloid parametric equations. (The equations were found on Wikipedia at http://en.wikipedia.org/wiki/Hypocycloid but the graphics are different than shown there.) It also draws a pentagon inside the curve, in a different color.

To use the program, press a number between 1 and 5, and it will draw the appropriate graphic. Dual framebuffers are used, but swapped regularly so that you can see the image as it's being drawn. When you're finished using the program, press Esc to exit.

Resposne to Instructor Questions

Question 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 callbacks -- functions that are called on events like display/redisplay, keypress or window reshape. This is configured through methods like glutDisplayFunc() or glutReshapeFunc() which take a function pointer as a parameter.

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

GLUT_RGBA says that we are use the Red-Green-Blue color model.

GLUT_DOUBLE syas to use double-buffering. It reads from one framebuffer while we write to a second, and then swaps those when we're done drawing the frame.

The | performs a bitwise OR, so that we create an int param that contains the bits for both the RGB and double-buffer constants.

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

glViewport() sets the size of the drawable region inside the window -- in this case, it's the entire window.

glOrtho() sets the coordinate system that we use. As originally specified, it set the coordinates to go from 0 to 1 on both the X and Y axis. (I modified it to go from -10 to 10 instead.)

Together these parameters enable us to resize the window and have the image scale accordingly.

Recent