Invitation to Computer Science 5th Edition
Chapter 16
Computer Graphics and Entertainment: Movies, Games, and
Virtual Communities
Invitation to Computer Science, 5th Edition 2
Objectives
In this chapter, you will learn about:
• Computer-generated imagery (CGI)
• Video gaming
• Multiplayer games and virtual communities
Invitation to Computer Science, 5th Edition 33
Introduction
• Computer-based entertainment – A $15–20 billion industry
• By the start of the twenty-first century:– Entertainment had become an application that stands
alongside traditionally “important” uses of computers
Invitation to Computer Science, 5th Edition 44
Computer-Generated Imagery (CGI)
• Advantages– Can produce extremely high-quality, lifelike images,
called photorealistic animation– Can generate images that are prohibitively expensive
to produce manually– Without it, directors would either have to:
• Hire thousands of extras
• Animate the scenes by hand, or
• Produce thousands of miniature models
Invitation to Computer Science, 5th Edition 5
How It’s Done: The Graphics Pipeline
• Graphics pipeline– Sequence of operations that must be completed
successfully to produce a realistic three-dimensional image
Invitation to Computer Science, 5th Edition 6
Figure 16.2 A Simplified Three-Stage Graphics Pipeline
Invitation to Computer Science, 5th Edition 7
Object Modeling
• First step in generating a three-dimensional image
• Creation of a mathematical or computational model of a three-dimensional object that: – Can be stored in memory and manipulated
algorithmically
Invitation to Computer Science, 5th Edition 8
Figure 16.3 Wireframe Model of a Dolphin (based on image in Wikipedia entry on polygon meshes)
Invitation to Computer Science, 5th Edition 9
Figure 16.4(a) Tesselation Producing Three Triangles and Five Vertices
Invitation to Computer Science, 5th Edition 10
Figure 16.4(b) Vertex List Representation of the Model in Figure 16.4(a)
Invitation to Computer Science, 5th Edition 11
Object Motion
• Rigid motion – Motion that does not bend or deform an object– Types: translation, rotation, and reflection
• Transformation matrix– Mathematical structure used to implement motions
• Advantage of CGI– Computer can perform many of the required
operations without the assistance of a human designer
Invitation to Computer Science, 5th Edition 12
Figure 16.5 The Three Types of Rigid Motion
Invitation to Computer Science, 5th Edition 13
Figure 16.6 Using Matrix Multiplication to Implement Object Translation
Invitation to Computer Science, 5th Edition 14
Object Motion (continued)
• Keyframing– Human animator only needs to produce:
• The first frame, containing the starting location of the object
• The last frame, containing the final location of the object
• The elapsed time
• Control point– Point or axis used to control the motion of an object
Invitation to Computer Science, 5th Edition 15
Figure 16.7 Example of a Translation Performed on the Object Shown in Figure 16.4(a)
Invitation to Computer Science, 5th Edition 16
Figure 16.8 Figure-8 Object
Rendering and Display
• Rendering – Taking an object stored as a mathematical model
and converting it into a fully formed, visually pleasing three-dimensional image
– Often consumes the vast majority of computer time required to produce an image
Invitation to Computer Science, 5th Edition 17
Invitation to Computer Science, 5th Edition 18
Rendering and Display (continued)
• Issues addressed during the rendering process– Lighting– Color shading– Shadows– Texture mapping– Blur
• Algorithms for carrying out rendering operations – Ray tracing, rasterization, and radiosity
Invitation to Computer Science, 5th Edition 19
Figure 16.10 Three Light Sources Illuminating Triangle T
Invitation to Computer Science, 5th Edition 20
Figure 16.11 Converting an Image to a Two-Dimensional Representation
Invitation to Computer Science, 5th Edition 21
The Future of CGI
• Parallel and multicore computers – Are becoming more common– Allow computers to overcome Moore’s law and
continue to gain in speed
• Computer scientists– Are discovering newer and better algorithms for such
common CGI operations as modeling, animation, and rendering
Invitation to Computer Science, 5th Edition 22
Video Gaming
• A movie is a static environment that is created once and shown as often as desired
• A video game is a highly interactive environment
• Real-time graphics– Branch of computer graphics that studies methods
for creating images at a rate matching that of the real world
• Graphics Processing Unit – Common technique for increasing imaging speed
Invitation to Computer Science, 5th Edition 23
Figure 16.12 Typical Architecture of a GPUand Video Memory
Invitation to Computer Science, 5th Edition 24
Video Gaming (continued)
• To achieve speedup in real-time graphics: – Avoid the use of algorithms that simply take too
much time
• Culling– Used to speed up rendering and display
• Cut-ins– Fully modeled and fully rendered objects stored in a
video library in video memory
Invitation to Computer Science, 5th Edition 25
Multiplayer Games and Virtual Communities
• Massively multiplayer on-line games (MMOG) – Allow a large number of players to interact, form
groups, and compete against one another within a simulated virtual world
• Game servers– Special computers used to manage simulated virtual
world
• In an MMOG: – The virtual world in which the game is played is
persistent
Invitation to Computer Science, 5th Edition 26
Multiplayer Games and Virtual Communities (continued)
• Client software– Users log on to the game server
• MMOG must address and solve the following technical problems– Registration management– Client/server protocols– Security– Database design
Invitation to Computer Science, 5th Edition 27
Figure 16.13 Architecture of an MMOG
Invitation to Computer Science, 5th Edition 28
Multiplayer Games and Virtual Communities (continued)
• Noncompetitive MMOG– Simulated virtual world where the goal is not to
destroy your opponent or get the highest score– Purpose of entering this metaverse is to:
• Explore the virtual world
• Interact with other people in the world
• Form communities of residents with similar interests
• Create new economic entities that have (virtual) value
Invitation to Computer Science, 5th Edition 29
Summary
• Computer-based entertainment – A $15–20 billion industry
• Object modeling– First step in generating a three-dimensional image
• Rigid motion – Motion that does not bend or deform an object
• Rendering – Often consumes the vast majority of computer time
required to produce an image
Invitation to Computer Science, 5th Edition 30
Summary (continued)
• Graphics Processing Unit – Common technique for increasing imaging speed
• Noncompetitive MMOG– Simulated virtual world where the goal is not to
destroy your opponent or get the highest score