MCIS 625: Computer Graphics
Winter 2004

WEEK 1

Instructor: Dr. Michael Laszlo


Assignment
  1. Download a VRML plugin and install it in your web browser. Test your plugin by visiting some pages that feature VRML worlds. Make sure that your plugin can load VRML worlds from your PC's hard drive (to test this you may wish to download and extract the files contained in my sample worlds zip file). See my course software page for more information on obtaining and using VRML. I'll have more to say about VRML in next week's lecture.
  2. Reading assignment: Begin reading the VRML 2.0 Sourcebook, from Chapter 1 on. In addition, as an optional assignment, read Chapters 1 and 2 of Foley et al.


Abstractions in computer graphics
I would like to briefly discuss an interesting analogy that exists between the process of writing and the process of creating computer imagery. When you write an essay, you think at different levels of abstraction. Although the essay emerges a character at a time, you do not spend time thinking about what sequence of characters to write down next. You do not ask yourself, what character should I type first, what character should I type second, and so on. (Were books written like this, our libraries would be most unimpressive!) Rather, you have in mind the book's theme and story, which you map to a series of chapters and incidents or topics. Each chapter, in turn, is broken down into a series of sections. The main idea or point of each section is mapped to a series of paragraphs. In turn, you transform each paragraph into sentences that express the paragraph's main idea, and then find words for the sentences. In summary, writing entails a top-down design, from higher-level abstractions to lower-level ones.

Analogously, when you paint into a raster device—a raster is another name for a frame buffer, the matrix of memory cells whose contents correspond to colors—you do not typically think at the level of individual pixels. You do not ask yourself what color you should paint this pixel or that pixel. Rather, you think in higher-levels abstractions. For example, if you are using a draw program, you think in terms of lines, circles and ovals, squares and other polygons, and curves; in terms of fill colors and patterns and stroke colors and patterns; and in terms of translating, scaling, rotating, duplicating, and deleting graphical objects. (The fill of an area-enclosing region is the region's interior; the stroke of a region is its boundary.) By way of another example, if you are using an an architectural drawing program, you think in terms of rooms, closets, bathrooms, doors, windows, chairs and tables and other pieces of furniture, and the like. By way of a third example, if you are using a paint program (in which you paint figures into the frame buffer), you think in terms of lines, curves, circles, polygons, and other figures; and in terms of gradients, textures, and color models.

Another example of abstraction in computer graphics involves creating 3D models in space, something we will look at later in the course. You can create spheres, cylinders, pyramids, toroids (i.e., donuts), and other objects in space, and manipulate these objects in many ways: rotate, translate, scale, shear, color, make transparent or reflective, duplicate, and so on. Yet such objects are commonly represented within the computer by a mesh of triangles approximating the object's surface. As a 3D sculptor, you generally need not be concerned about the underlying triangles, but can think in terms of higher-level abstractions like spheres and toroids. This is what makes 3D modeling possible, or at least convenient.

Chapter 2 of the Foley book employs many of these high-level abstractions for 2D raster graphics. These abstractions are the procedures supported by a simplified raster graphics package (SRGP). When you want to draw a line segment from point A to point B, you don't have to decide what pixels to light in order to represent the line, or what colors to paint these pixels. Instead, you can assume there exists a line drawing routine that can do this for you. In the case of the SRGP, these line-drawing routines are called SRGP_line and SRGP_lineCoord. To draw a polygon, you can use the routine SRGP_polyLine and SRGP_polygon. You can use the routine SRGP_rectangle to draw an unfilled polygon, and SRGP_fillRectangle to draw a filled one. There are also routines for setting and getting current attributes such as fill color and fill pattern.

SRGP is presented in this textbook to provide an idea of the kinds of abstractions supported by most any 2D raster graphics package. In practice, these graphics systems are more sophisticated than this. Examples include Microsoft's MFC, Apple's Toolbox, Java's AWT, and Silicon Graphic's OpenGL, Microsoft's DirectX, and the Java 3D API. However, the point here is not to have you master the SRGP (indeed, we will not use SRGP in this course). Rather, the point is to show how computer graphics is made possible by a sequence of systems each of which depends on the abstractions provided by the next-lower system.

Later we'll see how some of these abstractions are realized. In particular, we'll examine algorithms for doing such things as drawing lines and circles, filling regions, and clipping lines to polygons.


Other sources of information on computer graphics

Nan's Computer Graphics Page is a good online computer graphics reference; it contains a myriad of links to other sources of information. The UCSC Perceptual Science Laboratory is another good source, as is Yahoo's computer graphics directory. Please use our course forum to inform the class of other good sources of computer graphics information that you discover.


[ Home | Course | Syllabus ]