Rozanski, E.P. “Computer Graphics” The Electrical Engineering Handbook Ed. Richard C. Dorf Boca Raton: CRC Press LLC, 2000 91 Computer Graphics 91.1 Introduction 91.2 Graphics Hardware Hard Copy Technologies?Display Technologies?Standard CRT?Other Display Technologies 91.3 Graphics Software Engineering Software Packages?General Purpose Libraries and Packages?Solid Modeling Packages?Object-Oriented Programming?Plotting and Page Description Languages?Interaction 91.4 Conclusion 91.1 Introduction The term computer graphics refers to the generation, representation, manipulation, processing, and display of data by a computer. Computer-generated images may be real or imagined, animated or still, two-dimensional (2-D) or three-dimensional (3-D). Today most computers, particularly those in the PC, Macintosh, or workstation categories, have graphics capability. Their central components are a graphical display device, usually a cathode ray tube (CRT), and one or more input devices (e.g., keyboard, mouse, digitizer, data glove). Output devices include laser printers or video or such other displays as goggles or “eyephones” as in the case of some virtual reality systems. Computer graphics encompasses a wide variety of applications. It has expanded its scope from the mundane business/presentation graphics to placing desktop publishing at everyone’s fingertips. Highly interactive real- time systems are used in flight simulators where the display represents changes in the scene or landscape. In engineering, computer-aided design (CAD) systems allow users to create, store, manipulate, and test objects and designs. Fully integrated systems allow standard component parts libraries to be incorporated into a product. Product design and drafting information is fed into manufacturing operations via numerical control interfaces. Other engineering applications that make extensive use of graphics include very large scale integration (VLSI) and solid modeling. Graphics has emerged as the vehicle for visualizing physical phenomena and the volume visualization of complex datasets [Purgathofer and Schonhut, 1989; Vince, 1990; Kaufmen et al., 1996]. Some examples include the medical modeling of the anatomy and MRIs [Kaufmen et al., 1996]. One application simulates laboratory testing of a new friction material for disc brakes and visualizes temperature distribution of the brakes’ ability to conduct or absorb heat [Purgathofer and Schonhut, 1989]. In mathematics, B. B. Mandelbrot defined the geometry of fractals. Fractals, geometrical self-similar objects with fractional dimension, form a powerful tool for generating objects that resemble natural phenomena such as mountains, trees, and coastlines [de Ruiter, 1988; Mandelbrot, 1982]. In the world of animation, the computer has taken the drudgery out of transforming and redrawing objects. It has enhanced cell animation as well as produced glitzy Hollywood special effects such as morphing, a process of letting the computer transform one image to another by generating all the in-between images. One of the most spectacular uses of graphics is in the area of virtual reality (VR). This technology, which uses high-resolution graphics terminals and head-mounted displays (HMD) or eyephones, provides the user Evelyn P. Rozanski Rochester Institute of Technology ? 2000 by CRC Press LLC with a stereo view of a virtual world and an ability to navigate through it. These systems have a tracking device to determine the position of the user and devices, such as data gloves, for inputting commands [Thomas and Stuart, 1992]. Applications include simulation and architecture. Research in the area of computer graphics has centered on all aspects of hardware, software, and algorithm development. Some of these areas are 1.Object-oriented environments: Design of programming languages, tools, databases, user interfaces, and animation [Purgathofer and Schonhut, 1989; Cunningham et al., 1992; de Ruiter, 1988]. 2.Virtual reality: The design of system architecture, the creation and integration of component hardwares, the creation of software, the building of virtual environments, the development of real-world applica- tions, and the study of philosophical and human perceptual issues [Stuart, 1992]. 3. Scientific visualization: Graphics software solutions, practical implementations, user interfaces, high- resolution hard copy, data representation and metafiles [Purgathofer and Schonhut, 1989]. 4.Algorithmic design: Ray tracing [Straber, 1987]. 5.Hardware design: Workstation architectures, support for geometric modeling [Straber, 1987]. 6.Color models and manipulation [Purgathofer and Schonhut, 1989]. 7.Page description languages (PDLs): PostScript interpreters [Purgathofer and Schonhut, 1989]. 8.CAD and solid modeling: VLSI, data exchange, geometric modeling [de Ruiter, 1988; Purgathofer and Schonhut, 1989]. 91.2 Graphics Hardware Computer graphics systems comprise several different output components in which to display computer-generated images. These components are classified into two groups: (1) hard copy technologies and (2) display technologies. Hard Copy Technologies Hard copy technologies include printers, pen plotters, electrostatic plotters, laser printers, ink-jet plotters, thermal transfer plotters, and film recorders [Foley et al., 1996]. These devices use either a raster or vector style of drawing. The raster style uses discrete dots, and the vector style uses a continuous drawing motion. Each display device is distinguished by its dot size and the number of dots per inch, known as addressability. The closer the dots, the smoother the image. The smaller the dot, the finer the detail. Resolution is related to dot size and is the number of distinguishable lines per inch. This may vary in the horizontal and vertical directions. High-resolution devices have fine detail, smooth lines, and crisp images. Color may be achieved in several ways, depending on the device. Some devices use multicolored ribbons with single print heads, multiple print heads with different ribbons, or overstriking to combine colors. Other devices use color pens, spray (e.g., ink jet), toner (e.g., laser printer, electrostatic plotters), or pigment from colored wax paper (e.g., thermal transfer). The hard copy devices vary in color and intensity levels, addressability, dot size, cost, image quality, and speed. The laser printer is becoming the most common, high-quality output device in this category [Foley et al., 1996]. Display Technologies Displays are, for the most part, characterized by their responsiveness to a changing image. As with the hard copy technologies, display technologies vary greatly with respect to performance and cost. Guidelines for comparisons are based on the following characteristics: power consumption, screen size, depth, weight, rug- gedness, brightness, addressability, contrast, intensity levels per dot, viewing angle, color capability, and relative cost. Standard CRT The most common component of graphics displays has been the CRT, which is used in televisions. The CRT is composed of five parts: (1) the electron gun, which when heated emits electrons at an appropriate rate; (2) the control grid, which regulates the flow of electrons; (3) the focusing system, which concentrates the beam ? 2000 by CRC Press LLC into a fine point; (4) the deflection system, which directs the beam to the appropriate location; and (5) the phosphor screen, which glows when bombarded with the electron beam. The persistence of the phosphor is defined as the time from the removal of excitation to when the phosphorescence has decayed to 10% of the initial light output [Foley et al., 1996]. Depending on the persistence of the phosphor used, the screen will need to be continually refreshed, or redrawn. Color is produced by laying triads of red-green-blue (RGB) phosphors on the screen and using three electron guns, one for each color, to excite the corresponding phosphor. The raster CRT scans the image, one row at a time, from a matrix whose elements correspond to a pixel, or point on the screen. This matrix is referred to as the frame buffer and allows for a constant refresh rate, usually 60 times per second. Systems may also have more than one frame buffer (double buffer) to facilitate faster image generation. These displays include high resolution (1024 ′ 11280), SVGA (768 ′ 1024), NTSC (~350 ′ 480) and HDTV (720 ′ 1280 and 1080 ′ 1920) [Baily et al., 1996]. In vector CRT displays, the picture is generated in a continuous sweep, much like tracing an image on paper. The refresh rate on the vector displays is a function of the complexity of the image. The result may be a noticeable flicker on the screen. Other Display Technologies 1. Direct view storage tubes (DVST): These devices were the primary displays used in earlier systems. These vector drawing devices stored their images on a grid, which was continually bombarded with electrons in order to transfer the image to the screen. The advantage was that once the image was drawn, the refresh process took place independently of the complexity of the image, thereby producing a constant image on the screen. The disadvantage of these systems was that no part of the image could be selectively erased without erasing the entire grid and resending the modified image to the display. 2. Liquid crystal display (LCD): This device uses matrix addressing and refreshes the display one row at a time. Appropriate voltages are applied to the crystals, causing them to line up. They remain polarized, not allowing light to pass through; light is absorbed, causing dark spots on the display. These devices are light in weight, rugged, and have a low power consumption, fair intensity, and low cost. 3. Plasma panels: These devices have an array of neon bulbs between glass plates, which may be turned on or off. While color is possible, it has not been commercially available. These devices excel in screen size, weight, ruggedness, and brightness characteristics but are generally high in cost. 4. Electroluminescent displays: These devices also use a grid-like structure for addressing elements. The light-emitting material, a zinc sulfide doped with manganese, is available in color. These devices have excellent brightness characteristics but are high in cost. FIGURE 91.1 An example of a figure generated on the Macintosh with Microsoft Excel 3.0, showing the effect of four different treatments on two different measured variables. Although this information could be presented in two dimensions, the 3-D illustration can be more intuitive and interesting. ? 2000 by CRC Press LLC 91.3 Graphics Software Software for scientific and engineering applications has changed dramatically in the past several years. In the 1970s and early 1980s, there were few graphics software tools available. Most of the engineering packages were in the CAD area. Many specific engineering applications required users to develop and implement programs to solve their problems. These programs were written in the Fortran or C programming languages using low- level graphical commands or calls to some standard or quasi-standard (e.g., the CORE package) graphical routines. Most of these systems were developed for a mainframe computer environment. A trend begun in the late 1980s resulted in a change in computing hardware environments as well as in software approaches. Predominantly, the hardware platforms are PCs, microcomputers, and powerful Unix workstations, with most of these machines having excellent graphics capabilities. Software moved from code generation to customized stand-alone scientific and engineering software tools. Software development uses standard languages and graphical user interfaces for CH, C, Fortran, and Pascal, as well as more sophisticated languages such as JAVA, HyperText, Unix X.11, Microsoft’s Windows, and PostScript. The technical community is relying more and more on the increased power of computers to easily support software packages that manipulate complex data and represent them in a visual manner. Engineering Software Packages Several commercial scientific and engineering software packages have graphics functionality. It is difficult to distinguish graphics or visualization capabilities without discussing some of these packages. An excellent reference is found in the IEEE Spectrum Focus Report: Software. These graphical application software packages fall into five categories: 1. Logic simulation for application-specific integrated circuits (ASICs). Software in this area might display a schematic of a multigate ASIC from large functional building blocks. These blocks could represent a finite-state machine with several states and gates. Representative packages are Mentor Graphics’ Auto- Logic, Cadence Design Systems’ HDL Synthesizer and Optimizer, and Teradyne’s Frenchip. HDL is a hardware description language. 2. Electromagnetic design and simulation. Software in this area might simulate a printed-circuit board for a 32-bit-wide, 8-bit-byte reversal network. Multilayers of a board are displayed, with colors indicating current densities in lines. Representative systems are Hewlett-Packard’s High Frequency Structure Sim- ulator (HFSS), a finite-element-based product having animation of field plots and conductor loss and 3-D full-wave solution and S-parameter output; Sonnet Software’s “em” package with animation of conductor currents; and Compact Software’s Microwave Explorer with X-Windows and OSF Motif graphical interfaces. 3. Data acquisition, analysis, display, and technical reporting. Systems in this area have compute-intensive analysis routines and enhanced visualization of data which capitalize on sharper display resolutions. These packages could produce plots and graphs based on acquired data that are displayed in several windows at once; changes to one window could result in recalculation and updating of corresponding windows. Packages in this area frequently have support for standard languages and graphical user interfaces for C and Fortran as well as the Unix X.11 interface or Microsoft’s Windows. Representative packages are HP’s VEE-Test; Design Science’s MathType; DSP Development’s DADiSP; National Instru- ments’ LabWindows; Speakeasy Computing’s Speakeasy Zeta, which features user-tailored graphical user interface and PostScript output; and Mihalisin Associates’ Temple-Graph, which produces a color Post- Script output link to Mathematica. 4. Mathematical calculations and graphics for visualization. Applications for these packages would be curve fitting, evaluation of integrals, statistical analysis, signal processing, and numerical analysis. Features include programmability in languages such as C, Fortran, and Pascal and 2-D and 3-D representations. The leading package in this area is Mathematica by Wolfram Research, which is a general system and programming language for numerical, symbolic, and graphical computations in engineering, research, science, financial analysis, and education [Wolfram, 1991]. Other packages are Amtec Engineering’s Tecplot, Integrated Systems’ Xmath, MathWorks’ Mathlab, Jandel Scientific’s SigmaPlot, and NAG’s Axiom. ? 2000 by CRC Press LLC 5. Digital signal processors for embedded systems. The tools available in this area let the engineer focus on the application rather than the programming details. The Audio Frequency Fourier Analyzer by National Instruments is a combination of graphical programming with development software for the Macintosh environment. Signals can be analyzed, manipulated, and displayed using custom graphics software. Some packages allow for programming in C and user interfaces. Representative packages include FIGURE 91.2 Examples of rendered 3-D figures generated on the Macintosh 7100 computer with 2MB RAM using Strata Studio Pro software, showing the effects of different rendering, coloring, and lighting parameters on a 3-D scene. Computer artist: (top) Joel Rosen, (bottom) Alex Dao, M.F.A. in Computer Graphics Design program students, Rochester Institute of Technology. ? 2000 by CRC Press LLC Signal Technology’s N!Power, which has object-oriented programming and linkage to X-Windows, and Bitware Research Systems’ DsqHq with real-time graphics and algorithm design. General Purpose Libraries and Packages Traditionally, graphical software systems are developed as a result of programming in high-level languages with interfaces to standard or quasi-standard software packages. These packages attempt to address the issues of device independence and application program portability by allowing systems to drive a wide variety of display devices as well as isolating the programmer from machine-specific graphics commands. Portability of programs is enhanced by allowing the user to move an application from one system to another. The primary programming languages include C, Fortran, and Pascal. The quasi-standard graphical package is ACM/SIGGRAPH’s Core system developed in 1977 and revised in 1979. While it was not a formally recognized standard, it did fulfill a role as a baseline specification for graphical systems [Foley et al., 1996]. The two official standards are GKS-3D, the 3-D Graphical Kernel System; and FIGURE 91.3 Examples of 3-D figures generated on the Macintosh 7100 computer with 2MB RAM using Strata Studio Pro software, showing the effects of different rendering, coloring, and lighting paramaters on a 3-D scene. Computer artist: (top) Hyung-Joo Lee, (bottom) Jennifer Cisney, MFA in Computer Graphics Design Program students, Rochester Institute of Technology. ? 2000 by CRC Press LLC PHIGS and PHIGS+, the Programmer’s Hierarchical Interactive Graphics System. Both systems support graph- ics primitives, such as lines, polygons, and character strings, and their attributes. The GKS system allows for groupings into segments with no nesting capabilities. PHIGS supports geometrical transformations (i.e., scaling, translating, and rotating) and a database structure that allows for selective editing and manipulation of the picture. PHIGS runs best when there is hardware support for the transformation, clipping, and rendering features. Other software include the cross-platform OpenGL, which is a low-level graphics rendering and imaging library, and Inventor, which is object-oriented and built on top of Open GL [Reynolds and Danielson, 1996]. In traditional graphical systems development, image data are stored either as Cartesian coordinates or as vectors. These data are manipulated through the geometrical transformations of scaling, translating, and rotating in a reference system known as the world coordinate system (WCS). The units of the WCS system might be inches, millimeters, or miles. Physical devices use their own coordinate systems known as screen coordinate systems (SCS). In order to ready the image for display, a viewing transformation takes place, which changes the image data in the WCS to its corresponding device-specific screen coordinates in SCS. A window or portion of the world picture is chosen to be shown in an area of the display known as the viewport. Because some of the data in the world could be outside the window, a clipping operation is necessary. Clipping will eliminate any data points outside the window. These values are then converted to an intermediate coordinate system known as the normalized device coordinate system (NDC). Values in this system are in the range of 0 to 1. Because a viewport may be any portion of the display area and the image could be displayed on more than one device, the NDC values are easily adjusted to screen coordinates. In 3-D, the clipping volume uses the viewing transformation which must take into account the view reference point (i.e., the position from which an object is to be viewed) and the perspective or parallel projection (i.e., the conversion from the object’s 3-D coordinates to the screen’s 2-D coordinates). Solid Modeling Packages Feature-based systems such as solid or geometric modeling rather than mathematical-based systems form the basis of some CAD systems. Solid modeling (SM) systems use constructive solid geometry to build complicated objects. These systems have a descriptive language which uses a database of 3-D primitive objects such as block, cylinder, sphere, wedge, cone, and torus. These solids are combined to form other solids using the set operators of union, intersection, and difference. The resultant object can then be named, saved, and positioned into a picture or drawing. Attributes stored with the objects allow them to be displayed in wire-frame format or as a completely rendered image. Representative SM systems are MAGI (Mathematical Applications Group, Inc.), Synthavision, PADL-2 (Production Automation Project), GM Solid (a proprietary package of General Motors), and McDonnell Douglas’s UNISOLID [Teicholz, 1985]. Object-Oriented Programming Object-oriented programming is the paradigm for designing and implementing software and is particularly important in computer graphics. An engineering approach, these languages allow software to be constructed from reusable, interchangeable, and extensible parts [Cunningham et al., 1992]. Class libraries of graphical objects are being developed. Classes of objects are defined in terms of what an object can do (i.e., what actions and reactions it might produce) and communicate via messages. Subclasses inherit actions or characteristics of the superclass. For example, a robot could be constructed from instances of such classes as legs, arms, and head. Each class would have actions defined for it (e.g., a head would be able to nod up and down or shake from side to side). An instance of a head in the object robot would preserve these characteristics. Representative object-oriented languages are Smalltalk, C++, Objective-C, Actor, and Object Pascal. Plotting and Page Description Languages Plotting packages, such as ISSCO’s DISSPLA and Precision Visuals’ DI-3000, consist of routines that are callable from a high-level program. These packages handle 2-D and 3-D images and generally display them in a wire- frame format. ? 2000 by CRC Press LLC Page description languages are desktop publishing formats that produce graphical output on a printer, display, or other output device. They are used in application programs such as composition systems and illustrators where text, graphical shapes, and sampled images are to be combined into a single document. The dominant language in this category is PostScript, which is a simple interpretive programming language with powerful graphics capabilities. It communicates the description of a document to a printing system in a high level, device- independent manner. PostScript features construction of arbitrary shapes, which may self-intersect, be painted, transformed, cropped, or rendered. The commands are embedded in a general purpose programming language. PostScript programs can be created, transmitted, and interpreted in the form of ASCII source text. The resultant representations will allow for document interchange [Adobe, 1990]. Interaction The power of computer graphics is to be able to input commands or data in a manner that is appropriate for an application and to have the program react in a timely fashion. These interactions may involve typing words or labels, pointing to items or commands, specifying values or directions for movement, or choosing picture parts displayed on the screen. Some of the input devices that are available include mouse, special purpose keyboards using buttons or dials, data gloves and other VR devices, touch panels and screens, light pens, graphics tablets, joysticks, 3-D digitizers, trackballs, and voice systems. Each of these devices is capable of sending appropriate values to the graphics program for action [Hearn and Baker, 1997]. Graphics software packages categorize input devices as one of the following logical devices: 1. Locator: a device for specifying a coordinate position (x,y) or orientation (e.g., tablet) 2. Valuator: a device for specifying scalar values (e.g., dials) 3. Keyboard: a device for specifying text input 4. Pick: a device for selecting displayed entities (e.g., mouse) 5. Choice/button: a device for selecting among alternatives (e.g., function keys) In some systems, an input device might be used for more than one operation. For example, in the Macintosh computer, the mouse is used as a locator, valuator, and pick device [Foley et al., 1996]. 91.4 Conclusion The field of computer graphics has changed dramatically over the past decade. Scientific and engineering applications have expanded from the CAD systems to scientific visualization of complex systems, enhanced solid modeling systems, real-time animated simulations, and now to another dimension, virtual reality. On the hardware side, we have seen a movement from large, costly systems to putting the power and speed of computers with advanced graphics capabilities on a desktop. PCs, microcomputers, and professional work- stations have provided cost-effective platforms that are within the reach of every engineer. Interaction with a system has been simplified. In most cases, the user has been relieved of the task of keying in and remembering commands. By merely pointing to menu items, the user is led through a system. Advances in hardware have driven the software development side. Gone are the days of tediously program- ming and interfacing with low-level graphics commands. Off-the-shelf and vendor-supplied applications pack- ages that incorporate sophisticated graphics abound. These systems are characterized by user-friendly interfaces and high-quality output capabilities. When programming is necessary, high-level picture constructs through object-oriented environments make manipulation of graphical images more natural. Other support allows for high-level interfaces to X-Windows, Windows, and PostScript by providing the programmer with more graphical development tools. Overall, scientists and engineers will find the visual dimension for their applications an integral and common component of their tool kit. ? 2000 by CRC Press LLC Defining Terms Computer graphics: The generation, representation, manipulation, processing, and display of data by a computer. Fractals: Geometrical self-similar objects with fractional dimension. Object-oriented programming: An engineering approach that uses software constructs that are reusable, interchangeable, and extensible. Rendering: The preparation of the representation of an image to include illumination, shading, depth cueing, coloring, texture, and reflection. Scientific visualization: The use of computer graphics techniques to represent complex physical phenomena and multidimensional data in order to aid in its understanding and interpretation. Solid modeling: The use of constructive geometry to build complicated 3-D objects. Virtual reality (VR): Three or more dimensionality of computer-generated images, which give the user a sense of presence (i.e., a first-person experience) in the scene. Volume visualization: A method of extracting information from datasets with interactive graphics and imaging; it is concerned with the representation, manipulation, and rendering of volumetric data [Kaufmen et al., 1996]. Related Topics 87.2 High-Level Languages ? 89.2 Computer Output Printer Technologies References Adobe Systems Incorporated, PostScript Language Reference Manual, 2nd ed., Reading, Mass.: Addison-Wesley, 1990. L. Ammeraal, Programming Principles in Computer Graphics, New York: John Wiley, 1986. M. Bailey, A. Glassner, and P. Wenner, Introduction to Computer Graphics, Course Notes, 23rd International Conference on Computer Graphics and Interactive Techniques, SIGGRAPH ’96, New Orleans, LA, August 1996. M. Brown, Understanding PHIGS, TEMPLATE, San Diego: Megatek Corporation, 1985. S. Cunningham, N.K. Craighill, M.W. Fong, and J.R. Brown, Eds., Computer Graphics Using Object-Oriented Programming, New York: John Wiley, 1992. M.M. de Ruiter, Ed., Advances in Computer Graphics III, New York: Springer-Verlag, 1988. J.D. Foley, A. van Dam, S.K. Feiner, and J.F. Hughes, Computer Graphics: Principles and Practice, 2nd ed. in C, Reading, Mass.: Addison-Wesley, 1996. S. Harrington, Computer Graphics: A Programming Approach, New York: McGraw-Hill, 2nd ed., 1997. D. Hearn and M.P. Baker, Computer Graphics, Englewood Cliffs, N.J.: Prentice-Hall, 1986. A. Kaufman, R. Avila, B. Lorensen, L. Sobierajski, and R. Yagel, Volume Visualization: Principles and Practice, Course Notes, 23rd International Conference on Computer Graphics and Interactive Techniques, SIG- GRAPH ’96, New Orleans, LA, August, 1996. IEEE Spectrum Focus Report: Software, vol. 28, no. 11, November 1991. B.B. Mandelbrot, The Fractal Geometry of Nature, San Francisco: W.H. Freeman, 1982. W. Purgathofer and J. Schonhut, Eds., Advances in Computer Graphics V, New York: Springer-Verlag, 1989. T. Reynolds and K. Danielson, Programming with OpenGL: An Introduction, Course Notes, 23rd International Conference on Computer Graphics and Interactive Techniques, SIGGRAPH ’96, New Orleans, LA, August, 1996. W. Straber, Ed., Advances in Computer Graphics Hardware I, New York: Springer-Verlag, 1987. R. Stuart, “Virtual reality: directions in research and development,” Interactive Learning Int., vol, 8, pp. 95–100, 1992. E. Teicholz, Ed., CAD/CAM Handbook, New York: McGraw-Hill, 1985. J.C. Thomas and R. Stuart, “Virtual reality and human factors,” Proc. Human Factors Society, 36th Annual Meeting, 1992. J. Vince, The Language of Computer Graphics, New York: Van Nostrand Reinhold, 1990. S. Wolfram, Mathematica: A System for Doing Mathematics by Computer, 2nd ed., Redwood City, Calif.: Addison- Wesley, 1991. ? 2000 by CRC Press LLC Further Information Two professional computing organizations publish periodicals that are specifically devoted to the field of computer graphics and provide an excellent forum for current research and techniques. The Association for Computing Machinery (ACM) publishes ACM Transactions on Graphics and the IEEE publishes IEEE Computer Graphics and Applications. SIGGRAPH, ACM’s special interest group on graphics, sponsors an annual conference and exhibit as well as offering a variety of tutorials and course notes. Other major conferences are sponsored by the National Computer Graphics Association and Eurographics. ? 2000 by CRC Press LLC