Chapter 14: Simulation, Graphics, and Other Applications Chapter 14 Simulation, Graphics, and Other...

14
Chapter 14: Simulation, Chapter 14: Simulation, Graphics, and Other Graphics, and Other Applications Applications Chapter 14 Chapter 14 Simulation, Simulation, Graphics, Graphics, and Other and Other Applications Applications Page Page 1 In order to gain insight into complex systems, In order to gain insight into complex systems, scientists often build computer models to scientists often build computer models to simulate their performance. simulate their performance. Continuous Dynamic Continuous Dynamic Simulation Simulation Elaborate equations Elaborate equations representing the different representing the different aspects of the model are aspects of the model are periodically solved to periodically solved to generate a sequence of generate a sequence of Discrete Event Discrete Event Simulation Simulation The system is The system is represented as a represented as a chronological sequence chronological sequence of events, each of which of events, each of which subtly impacts the subtly impacts the

Transcript of Chapter 14: Simulation, Graphics, and Other Applications Chapter 14 Simulation, Graphics, and Other...

Page 1: Chapter 14: Simulation, Graphics, and Other Applications Chapter 14 Simulation, Graphics, and Other Applications Page 148 In order to gain insight into.

Chapter 14: Simulation, Chapter 14: Simulation, Graphics, and Other Graphics, and Other ApplicationsApplications

Chapter 14Chapter 14Simulation, Simulation, Graphics, Graphics, and Other and Other

ApplicationsApplicationsPage Page 11

In order to gain insight into complex systems, In order to gain insight into complex systems, scientists often build computer models to simulate scientists often build computer models to simulate their performance.their performance.

Continuous Dynamic Continuous Dynamic SimulationSimulation

Elaborate equations Elaborate equations representing the different representing the different aspects of the model are aspects of the model are

periodically solved to periodically solved to generate a sequence of generate a sequence of

snapshots of its snapshots of its performance (e.g., flight performance (e.g., flight

simulators).simulators).

Discrete Event SimulationDiscrete Event SimulationThe system is The system is

represented as a represented as a chronological sequence of chronological sequence of

events, each of which events, each of which subtly impacts the overall subtly impacts the overall state of the system (e.g., state of the system (e.g.,

network modeling).network modeling).

Page 2: Chapter 14: Simulation, Graphics, and Other Applications Chapter 14 Simulation, Graphics, and Other Applications Page 148 In order to gain insight into.

Computer GraphicsComputer Graphics

Chapter 14Chapter 14Simulation, Simulation, Graphics, Graphics, and Other and Other

ApplicationsApplicationsPage Page 22

Recent advances in processor power, Recent advances in processor power, display technology, memory capacity, and display technology, memory capacity, and rendering algorithms have made it possible rendering algorithms have made it possible to produce dazzling images using relatively to produce dazzling images using relatively inexpensive computers.inexpensive computers.

Page 3: Chapter 14: Simulation, Graphics, and Other Applications Chapter 14 Simulation, Graphics, and Other Applications Page 148 In order to gain insight into.

Drawing Lines and CirclesDrawing Lines and Circles

Chapter 14Chapter 14Simulation, Simulation, Graphics, Graphics, and Other and Other

ApplicationsApplicationsPage Page 33

Pixel-based display technologies cause inherent Pixel-based display technologies cause inherent problems when displaying circles or non-problems when displaying circles or non-vertical/non-horizontal lines.vertical/non-horizontal lines.

Page 4: Chapter 14: Simulation, Graphics, and Other Applications Chapter 14 Simulation, Graphics, and Other Applications Page 148 In order to gain insight into.

AntialiasingAntialiasing

Chapter 14Chapter 14Simulation, Simulation, Graphics, Graphics, and Other and Other

ApplicationsApplicationsPage Page 44

Complex scenes lose their integrity when Complex scenes lose their integrity when using single-colored pixels.using single-colored pixels.

Jagged ProfilesJagged Profiles Loss Of DetailLoss Of Detail Disintegrating Disintegrating TexturesTextures

A common way to A common way to address this address this

problem is with problem is with antialiasingantialiasing

algorithms, which algorithms, which combine the colors combine the colors

affecting a affecting a particular pixel into particular pixel into

a “blended” color a “blended” color that will minimize that will minimize

these negative these negative effects.effects.

Page 5: Chapter 14: Simulation, Graphics, and Other Applications Chapter 14 Simulation, Graphics, and Other Applications Page 148 In order to gain insight into.

3D Shading3D Shading

Chapter 14Chapter 14Simulation, Simulation, Graphics, Graphics, and Other and Other

ApplicationsApplicationsPage Page 55

The easiest way to store The easiest way to store information about most information about most 3D objects is as a set of 3D objects is as a set of

polygons.polygons.

Unfortunately, smooth Unfortunately, smooth objects aren’t necessarily objects aren’t necessarily

polyhedral, so the polyhedral, so the resulting image looks resulting image looks

bad.bad.

The common solution to The common solution to this problem is to use a this problem is to use a

shadingshading algorithm, which algorithm, which progressively blends the progressively blends the

shading of adjacent shading of adjacent polygons to smooth out polygons to smooth out

the reflection of the the reflection of the virtual light across the virtual light across the

surface.surface.

Page 6: Chapter 14: Simulation, Graphics, and Other Applications Chapter 14 Simulation, Graphics, and Other Applications Page 148 In order to gain insight into.

Lighting EffectsLighting Effects

Chapter 14Chapter 14Simulation, Simulation, Graphics, Graphics, and Other and Other

ApplicationsApplicationsPage Page 66

In order to accurately In order to accurately model lighting effects, the model lighting effects, the

shading algorithm must shading algorithm must take into account the take into account the

position of the graphical position of the graphical scene’s virtual light source scene’s virtual light source and the rendered objects’ and the rendered objects’

locations with respect to it.locations with respect to it.

More sophisticated lighting More sophisticated lighting models take into account models take into account

radiosityradiosity, the fact that light , the fact that light reflects off the surface of reflects off the surface of some objects and, in turn, some objects and, in turn, illuminates other objects.illuminates other objects.

Page 7: Chapter 14: Simulation, Graphics, and Other Applications Chapter 14 Simulation, Graphics, and Other Applications Page 148 In order to gain insight into.

Ray TracingRay Tracing

Chapter 14Chapter 14Simulation, Simulation, Graphics, Graphics, and Other and Other

ApplicationsApplicationsPage Page 77

Rays are cast Rays are cast from the from the viewer’s position viewer’s position through each through each pixel; the first pixel; the first object that’s hit object that’s hit is the one that’s is the one that’s rendered in that rendered in that pixel.pixel.

To calculate shadows, To calculate shadows, the ray is bounced the ray is bounced

from the hit object to from the hit object to the scene’s light the scene’s light

source, if another source, if another object is hit on the object is hit on the

way to the light, then way to the light, then the original object is in the original object is in

shadow.shadow.

To calculate To calculate reflections, the reflections, the ray is bounced ray is bounced from the hit from the hit object (if it’s object (if it’s shiny) at the shiny) at the opposite angle at opposite angle at which it hit the which it hit the object; if another object; if another object is hit, then object is hit, then the second object the second object will be reflected will be reflected on the surface of on the surface of the first object.the first object.

Page 8: Chapter 14: Simulation, Graphics, and Other Applications Chapter 14 Simulation, Graphics, and Other Applications Page 148 In order to gain insight into.

Texture MappingTexture Mapping

Chapter 14Chapter 14Simulation, Simulation, Graphics, Graphics, and Other and Other

ApplicationsApplicationsPage Page 88

To give a greater sense of realism to 3D graphical To give a greater sense of realism to 3D graphical objects, objects, texture mappingtexture mapping provides an inexpensive provides an inexpensive means of placing 2D “wallpaper” around the means of placing 2D “wallpaper” around the objects.objects.

Bump mappingBump mapping can make the results even more can make the results even more visually striking, by adding a displacement factor visually striking, by adding a displacement factor across the surface of the objects, giving the across the surface of the objects, giving the illusion of 3D texture in the resulting lighting illusion of 3D texture in the resulting lighting effects.effects.

Page 9: Chapter 14: Simulation, Graphics, and Other Applications Chapter 14 Simulation, Graphics, and Other Applications Page 148 In order to gain insight into.

Character AnimationCharacter Animation

Chapter 14Chapter 14Simulation, Simulation, Graphics, Graphics, and Other and Other

ApplicationsApplicationsPage Page 99

By strategically manipulating specific By strategically manipulating specific vertices comprising an animated model, a vertices comprising an animated model, a graphics artist can make the model behave graphics artist can make the model behave in a lifelike manner.in a lifelike manner.

Page 10: Chapter 14: Simulation, Graphics, and Other Applications Chapter 14 Simulation, Graphics, and Other Applications Page 148 In order to gain insight into.

Embedded SystemsEmbedded Systems

Chapter 14Chapter 14Simulation, Simulation, Graphics, Graphics, and Other and Other

ApplicationsApplicationsPage Page 1010

Special-purpose computer systems are Special-purpose computer systems are often designed to perform a specific list of often designed to perform a specific list of dedicated tasks.dedicated tasks.

Embedded systems:Embedded systems:•are often built into the devices they control, rather are often built into the devices they control, rather than being separate devices.than being separate devices.•frequently have real-time performance constraints.frequently have real-time performance constraints.•often have low performance requirements, allowing often have low performance requirements, allowing cheaper hardware to be used.cheaper hardware to be used.•use software called use software called firmwarefirmware, usually stored in ROM or , usually stored in ROM or flash memory.flash memory.

Page 11: Chapter 14: Simulation, Graphics, and Other Applications Chapter 14 Simulation, Graphics, and Other Applications Page 148 In order to gain insight into.

Electronic CommerceElectronic Commerce

Chapter 14Chapter 14Simulation, Simulation, Graphics, Graphics, and Other and Other

ApplicationsApplicationsPage Page 1111

As networking capabilities have become As networking capabilities have become ubiquitous, the ability to conduct financial ubiquitous, the ability to conduct financial business electronically has soared.business electronically has soared.

Page 12: Chapter 14: Simulation, Graphics, and Other Applications Chapter 14 Simulation, Graphics, and Other Applications Page 148 In order to gain insight into.

Computer SecurityComputer Security

Chapter 14Chapter 14Simulation, Simulation, Graphics, Graphics, and Other and Other

ApplicationsApplicationsPage Page 1212

A computer virus piggybacks on another file to A computer virus piggybacks on another file to “infect” a system.“infect” a system.

When a user runs an When a user runs an infected program, the infected program, the

computer starts by copying computer starts by copying the program from the disk, the program from the disk,

where it is stored and where it is stored and inactive, into RAM, where it inactive, into RAM, where it

can be executed.can be executed.

The viral code begins The viral code begins running first, while running first, while

the infected program the infected program is still quiescent.is still quiescent.

The virus copies itself in The virus copies itself in a part of RAM separate a part of RAM separate

from the program so that from the program so that it can continue its work it can continue its work

even after the user even after the user starts running other starts running other

software.software.

Its initial work done, Its initial work done, the virus passes the virus passes

control back to the control back to the infected program.infected program.

When the user runs a When the user runs a different program, the different program, the dormant virus begins dormant virus begins

running again.running again.

It inserts a copy of It inserts a copy of itself into the itself into the

previously uninfected previously uninfected software so that the software so that the cycle of virulence can cycle of virulence can

repeat.repeat.

Page 13: Chapter 14: Simulation, Graphics, and Other Applications Chapter 14 Simulation, Graphics, and Other Applications Page 148 In order to gain insight into.

Worms and Trojan HorsesWorms and Trojan Horses

Chapter 14Chapter 14Simulation, Simulation, Graphics, Graphics, and Other and Other

ApplicationsApplicationsPage Page 1313

WormsWorms are parasitic are parasitic computer programs computer programs that replicate, but that replicate, but

unlike viruses, do not unlike viruses, do not infect other computer infect other computer

program files.program files.

Worms can create Worms can create copies on the same copies on the same computer, or can computer, or can

send the copies to send the copies to other computers via a other computers via a

network.network.

Worms often spread Worms often spread via e-mail or chat via e-mail or chat

applications. applications.

A A Trojan horseTrojan horse is a malicious is a malicious program that pretends to be a program that pretends to be a

benign application.benign application.

A Trojan horse program A Trojan horse program purposefully does something purposefully does something

the user does not expect.the user does not expect.

Trojan horses are not viruses Trojan horses are not viruses since they do not replicate, but since they do not replicate, but they can be just as destructive.they can be just as destructive.

One type of Trojan horse, One type of Trojan horse, known as a known as a logic bomblogic bomb, is set , is set

to execute whenever a specific to execute whenever a specific event occurs (e.g., a change in event occurs (e.g., a change in

a file, a particular series of a file, a particular series of keystrokes, a specific time or keystrokes, a specific time or

date).date).

Page 14: Chapter 14: Simulation, Graphics, and Other Applications Chapter 14 Simulation, Graphics, and Other Applications Page 148 In order to gain insight into.

Fighting VirusesFighting Viruses

Chapter 14Chapter 14Simulation, Simulation, Graphics, Graphics, and Other and Other

ApplicationsApplicationsPage Page 1414

Various techniques have been developed to Various techniques have been developed to combat computer viruses.combat computer viruses.

Generic Antiviral Generic Antiviral ProgramProgram

Flags activities--such as Flags activities--such as the alteration of critical the alteration of critical

sites in RAM or particular sites in RAM or particular files on files on

disk--that are likely to disk--that are likely to arise from a virus in arise from a virus in

action. Preventing these action. Preventing these illicit acts will not illicit acts will not

eliminate the virus but eliminate the virus but can stop it from infecting can stop it from infecting additional programs or additional programs or

interfering with the interfering with the computer's normal computer's normal

operation. operation.

Signature Signature ScannerScanner

Searches a Searches a user's disks user's disks looking for looking for

fragments of fragments of program code program code that appear in that appear in

known viruses. known viruses.

Antiviral SnapshotsAntiviral SnapshotsCapture mathematical Capture mathematical

"fingerprints" of crucial "fingerprints" of crucial programs and data. programs and data. Subsequent changes Subsequent changes strongly suggest viral strongly suggest viral infection. Advanced infection. Advanced

algorithms can use the algorithms can use the original fingerprints to original fingerprints to

recover a pristine recover a pristine program from the virus-program from the virus-

altered version. altered version.