cs 535 intermediate computer graphics

102
CS Dept, UK 1 CS 535 Computer Graphics Department of Computer Science College of Engineering University of Kentucky Fuhua (Frank) Cheng Rm 303, Davis Marksbury Bldg 329 Rose Street Lexington, KY 40506-0633

Upload: others

Post on 28-Nov-2021

13 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: CS 535 Intermediate Computer Graphics

CS Dept, UK1

CS 535 Computer Graphics

Department of Computer Science

College of Engineering

University of Kentucky

Fuhua (Frank) Cheng

Rm 303, Davis Marksbury Bldg

329 Rose Street

Lexington, KY 40506-0633

Page 2: CS 535 Intermediate Computer Graphics

CS Dept, UK2

1. Introduction

1.1 Graphics Areas

– Modeling: building specification of shape and

appearance properties that can be stored in computer

– Rendering: creation of shaded images from 3D

computer models

– Animation: to create an illusion of motion through

sequences of images

Page 3: CS 535 Intermediate Computer Graphics

CS Dept, UK3

Modeling

For example, how should

the pyramid on the right be

represented internally?

You need to record both

geometric and topological

Information:

Vertex Table + Edge Table

Page 4: CS 535 Intermediate Computer Graphics

CS Dept, UK4

or, these?

shape design/representation using:

implicit surfaces, parametric

surfaces, subdivision surfaces, …

Modeling

Page 5: CS 535 Intermediate Computer Graphics

CS Dept, UK5

or, these?

particle system

Modeling

Page 6: CS 535 Intermediate Computer Graphics

CS Dept, UK6

Context free grammar

(fractals, L-system)

Modeling

Or, these?

Page 7: CS 535 Intermediate Computer Graphics

CS Dept, UK7

Rendering

How should images like these be generated?

Page 8: CS 535 Intermediate Computer Graphics

CS Dept, UK8

Rendering

Or these?

Page 9: CS 535 Intermediate Computer Graphics

CS Dept, UK9

Animation

How should an illusion

of motion be generated?

Page 10: CS 535 Intermediate Computer Graphics

CS Dept, UK10

⚫ Fat horse animation

Animation

Page 11: CS 535 Intermediate Computer Graphics

CS Dept, UK11

Advantages

❖ Quantitative description

- precise, not easy to be

recognized

❖ Pictorial description

- easy to be recognized

(a picture is worth a

thousand words)

Page 12: CS 535 Intermediate Computer Graphics

CS Dept, UK12

History

Founded by the PhD thesis of Ivan D. Sutherland

at MIT in 1963,

- A line drawing system with data structures for storing symbol hierarchies and interaction techniques

SIGGRAPH: important CG organization, formed in 1969

Website: http://www.siggraph.org

Page 13: CS 535 Intermediate Computer Graphics

CS Dept, UK13

Computer Graphics, Computer Vision & Image Processing

Graphics Pattern recognition

(computer vision)

Image processing

(blending together more each year)

Image

Description

Page 14: CS 535 Intermediate Computer Graphics

CS Dept, UK14

1.2 Applications

⚫ Art, Entertainment, and Publishing

– Movie production, Animation, and Special

Effects

– Computer Games

– Browsing on the World Wide Web

– Slide, Book and Magazine Design

Page 15: CS 535 Intermediate Computer Graphics

CS Dept, UK15

Examples

Page 16: CS 535 Intermediate Computer Graphics

CS Dept, UK16

1.2 Applications

⚫ Process Control (Monitoring)

– Status display for refineries, power plants,

computer networks from sensors attached to

critical components

⚫ Simulation

- Flight simulation

- Simulation of the movement of a robot

- Simulation of ’virtual world’

Page 17: CS 535 Intermediate Computer Graphics

CS Dept, UK17

Virtual World

Page 18: CS 535 Intermediate Computer Graphics

CS Dept, UK18

1.2 Applications

⚫ Computer Aided Design (CAD)

- Computer Aided Mechanical Part Design (big

market)

- Computer Aided Architectural Design

- Electrical Circuit (IC) Design (big market)

Page 19: CS 535 Intermediate Computer Graphics

CS Dept, UK19

Examples of CAD

Page 20: CS 535 Intermediate Computer Graphics

CS Dept, UK20

1.2 Applications

⚫ Scientific Analysis and Visualization

– Assist scientists in understanding measured

data

– Provide insight into complex mathematical

ideas

Page 21: CS 535 Intermediate Computer Graphics

CS Dept, UK21

Bar chart

91

51 48 46 50

364

172

388

260

137

52 4768

40 34

0

50

100

150

200

250

300

350

400

Mit (1) Staford (2) CMU (3) Berkeley (4) Cornell (5)

Faculty

PhD Students

PhDs graduated

Page 22: CS 535 Intermediate Computer Graphics

CS Dept, UK22

1.3 Elements of Pictures Created inComputer Graphics

⚫ Output Primitive:

- polylines

- text

- filled regions

- raster images

Page 23: CS 535 Intermediate Computer Graphics

CS Dept, UK23

Examples

Page 24: CS 535 Intermediate Computer Graphics

CS Dept, UK24

1.4 A Graphics System

Mouse

Tablet

Key

board

Input

Device

Output

Device

monitor

Memory

Processor Frame

buffer

Pointing

devices

Page 25: CS 535 Intermediate Computer Graphics

CS Dept, UK25

Cathode Ray Tube (CRT)

Output Devices (Video monitors)

Liquid Crystal Display (LCD)

(Flat-panel display)

Page 26: CS 535 Intermediate Computer Graphics

CS Dept, UK26

Control

grid

Focusing

system Vertical

deflection

Horizontal

deflection

(Electron lens)

Cathode

Heating

filament

Phospher

coating

Metallic

coatingVideo Monitor (CRT)

Electron gun Deflection systems Dis

pla

y s

urfa

ce

Page 27: CS 535 Intermediate Computer Graphics

CS Dept, UK27

Video Monitor (CRT)

Electron gun: generate an electron beam to excite

pixels of the display surface

Deflection systems: to guide/control direction of

the electron beam (to trace a

picture on screen)

(most crucial part of the monitor)

Display surface: where image is created/shown

Page 28: CS 535 Intermediate Computer Graphics

CS Dept, UK29

Control

grid

Focusing

system

Vertical

deflection

Horizontal

deflection

(Electron lens)

Cathode

Heating

filament

Phospher

coating

Metallic

coating

Electron gun

Video Monitor (CRT)

--

--

--

--

--

--

: : : : : : : :

Electrons

Negative

voltage

Page 29: CS 535 Intermediate Computer Graphics

CS Dept, UK30

Control

grid

Focusing

system

Vertical

deflection

Horizontal

deflection

(Electron lens)

Cathode

Heating

filament

Phospher

coating

Metallic

coating

Electron gun

Electron

bean

Video Monitor (CRT)

+ +

+ +

+ +

+ +

+

- - - - -

- - - - -

Page 30: CS 535 Intermediate Computer Graphics

CS Dept, UK31

Where is “light” from?

Phospher: when struck by electron beams, kinetic

energy carried by the electrons is transferred to the

electrons of the phospher atoms, so the electrons of

the phospher atoms jump to a higher quantum

energy levels.

These excited electrons return to their previous

quantum levels by giving up their extra energy in

the form of light at frequency depicted by the

quantum theory

Page 31: CS 535 Intermediate Computer Graphics

CS Dept, UK32

Energy → Light

Quantum

level

Time

Stable

level

Start to release

quantum energy in

the form of light

Energy level is

stable again,

no light emitted

after this point

persistence

Page 32: CS 535 Intermediate Computer Graphics

CS Dept, UK33

Control

grid

Focusing

system

Vertical

deflection

Horizontal

deflection

(Electron lens)

Cathode

Heating

filament

Phospher

coating

Metallic

coating

Electron gun

Electron

bean

Video Monitor (CRT)

+ +

+ +

+ +

+ +

+

- - - - -

- - - - -

Light

Page 33: CS 535 Intermediate Computer Graphics

CS Dept, UK34

Control

grid

Focusing

system

Vertical

deflection

Horizontal

deflection

(Electron lens)

Cathode

Heating

filament

Phospher

coating

Metallic

coating

Electron gun

Electron

bean

Video Monitor (CRT)

+ +

+ +

+ +

+ +

+

- - - - -

- - - - -

Light

- - - - -

+ + + +

Page 34: CS 535 Intermediate Computer Graphics

CS Dept, UK35

Why is ‘refresh’ necessary?

Persistence: the time from the removal of excitation

to the moment when phosphersense decayed to 10%

of the initial light output

Refresh rate: number of times per second a picture

is redrawn (determined by persistence)

Fusion frequency: the refresh rate above which a

picture stops flickering & fuses into a steady picture

Page 35: CS 535 Intermediate Computer Graphics

CS Dept, UK36

Note

⚫ Refresh rate for raster scan display is fixed (30 to

120), independent of the picture complexity

⚫ Highly dynamic applications (such as computer

games) need low-persistence phospher.

CAD applications tend to use long-persistence

phospher.

⚫ The relationship between fusion frequency and

persistence is nonlinear.

Page 36: CS 535 Intermediate Computer Graphics

CS Dept, UK37

1.5 Display Processing Unit

Image

Storage

System

Image

Display

System

Image

Creation

SystemCPU

(Scan

Conversion)(Frame

Buffer)

(Image

Controller)

Display

Page 37: CS 535 Intermediate Computer Graphics

38

Scan

Controller

Frame Buffer

Intensity

To

Deflection

Display Processing Unit (a simple two-color

raster –scan system)

1 0 0 1 1 0 1

Pixel value

X-address

Y-address

1

0 0 0

0 1 1

1 0 1 1 0 0 1 0

Display Screen

1

Image Controller

(DPU)

Page 38: CS 535 Intermediate Computer Graphics

CS Dept, UK39

Image Creation System

⚫Scan-converts abstract representation

of an image into appropriate pixel

values in the frame buffer

Page 39: CS 535 Intermediate Computer Graphics

40

Frame Buffer

Scan Conversion

(a, b)

(c, d)

(Scan Conversion)

(p, q)

(r, s)

Page 40: CS 535 Intermediate Computer Graphics

CS Dept, UK41

Image Storage System(frame buffer, bitmap)

⚫ refresh memory arranged as a 2D array; each

entry corresponds to a screen pixel

(i.e., dimension of the frame buffer is the same

as the resolution of the screen)

⚫ each entry is composed of a number of bits;

brightness and/or color value of each pixel of the

screen is stored in corresponding entry in frame

buffer

⚫ implemented with solid state RAM

Page 41: CS 535 Intermediate Computer Graphics

42

Scan

Controller

Frame Buffer

Intensity

To

Deflection

Image Storage System (a simple two-color

raster –scan system)

1 0 0 1 1 0 1

Pixel value

X-address

Y-address

1

0 0 0

0 1 1

1 0 1 1 0 0 1 0

Display Screen

1

Page 42: CS 535 Intermediate Computer Graphics

CS Dept, UK43

Image Display System(video/image controller, DPU)

⚫ cycle through frame buffer row by row,

60 or 120 times/sec

⚫ memory reference addresses are generated in

synchronism with the raster scan; contents of the

memory are used to control monitor beam’s intensity

⚫ changes in frame buffer is done during the 1.3

millisecond flyback (or, vertical retrace) time

⚫ interlaced raster scan (to produce a picture whose

effective refresh rate is closer to 120 than to 60 Hz).

Page 43: CS 535 Intermediate Computer Graphics

44

Scan

Controller

Frame Buffer

Intensity

To

Deflection

Image Display System (a simple two-color

raster –scan system)

1 0 1 1 0 0 1 0

Pixel value

X-address

Y-address

Image Controller

1 0 1 1 0 0 1 0

1 0 1 1 1 0 1 1

1 0 1 1 0 0 1 0

1 0 1 1 0 0 1 0

0 0 1 1 1 0 1 1

0 0 1 1 1 0 1 1

0 0 1 1 1 0 1 1

Page 44: CS 535 Intermediate Computer Graphics

45

Scan

Controller

Frame Buffer

Intensity

To

Deflection

Image Display System (a simple two-color

raster –scan system)

1 0 1 1 0 0 1 0

Pixel value

X-address

Y-address

1

0 0 0

0 0 0

Image Controller

1 0 1 1 0 0 1 0

1 0 1 1 1 0 1 1

1 0 1 1 0 0 1 0

1 0 1 1 0 0 1 0

0 0 1 1 1 0 1 1

0 0 1 1 1 0 1 1

0 0 1 1 1 0 1 1

First row, first pixel

Page 45: CS 535 Intermediate Computer Graphics

46

Scan

Controller

Frame Buffer

Intensity

To

Deflection

Image Display System (a simple two-color

raster –scan system)

1 0 1 1 0 0 1 0

Pixel value

X-address

Y-address

0

0 0 1

0 0 0

Image Controller

1 0 1 1 0 0 1 0

1 0 1 1 1 0 1 1

1 0 1 1 0 0 1 0

1 0 1 1 0 0 1 0

0 0 1 1 1 0 1 1

0 0 1 1 1 0 1 1

0 0 1 1 1 0 1 1

First row, second pixel

Page 46: CS 535 Intermediate Computer Graphics

47

Scan

Controller

Frame Buffer

Intensity

To

Deflection

Image Display System (a simple two-color

raster –scan system)

1 0 1 1 0 0 1 0

Pixel value

X-address

Y-address

1

0 1 0

0 0 0

Image Controller

1 0 1 1 0 0 1 0

1 0 1 1 1 0 1 1

1 0 1 1 0 0 1 0

1 0 1 1 0 0 1 0

0 0 1 1 1 0 1 1

0 0 1 1 1 0 1 1

0 0 1 1 1 0 1 1

First row, third pixel …

Page 47: CS 535 Intermediate Computer Graphics

48

Scan

Controller

Frame Buffer

Intensity

To

Deflection

Image Display System (a simple two-color

raster –scan system)

1 0 1 1 0 0 1 0

Pixel value

X-address

Y-address

1

0 0 0

0 0 1

Image Controller

1 0 1 1 0 0 1 0

1 0 1 1 1 0 1 1

1 0 1 1 0 0 1 0

1 0 1 1 0 0 1 0

0 0 1 1 1 0 1 1

0 0 1 1 1 0 1 1

0 0 1 1 1 0 1 1

Second row, first pixel …

Page 48: CS 535 Intermediate Computer Graphics

49

Scan

Controller

Frame Buffer

Intensity

To

Deflection

Image Display System (a simple two-color

raster –scan system)

1 0 1 1 0 0 1 0

Pixel value

X-address

Y-address

0

1 1 1

1 1 1

Image Controller

1 0 1 1 0 0 1 0

1 0 1 1 1 0 1 1

1 0 1 1 0 0 1 0

1 0 1 1 0 0 1 0

0 0 1 1 1 0 1 1

0 0 1 1 1 0 1 1

0 0 1 1 1 0 1 1

Last row, last pixel ( 1/ 60 sec)

Page 49: CS 535 Intermediate Computer Graphics

50

Scan

Controller

Frame Buffer

Intensity

To

Deflection

Image Display System (a simple two-color

raster –scan system)

1 0 1 1 0 0 1 0

Pixel value

X-address

Y-address

….

0 0 0

0 0 0

Image Controller

1 0 1 1 0 0 1 0

1 0 1 1 1 0 1 1

1 0 1 1 0 0 1 0

1 0 1 1 0 0 1 0

0 0 1 1 1 0 1 1

0 0 1 1 1 0 1 1

0 0 1 1 1 0 1 1

Fly back (to do the next refresh cycle)

(1.3 millisecond; update frame buffer)

Page 50: CS 535 Intermediate Computer Graphics

51

Scan

Controller

Frame Buffer

Intensity

To

Deflection

1 0 0 0

Pixel value

X-address

Y-address

?

0 0 0

0 0 0

Image Controller

1 1 0 0

1 1 1 0

1 1 1 0

Do a right-shift of the X- and the Y-registers before

sending the indices to the Frame Buffer

What if dimension of the frame buffer is differentfrom resolution of the display surface?

Page 51: CS 535 Intermediate Computer Graphics

52

Scan

Controller

Intensity

To

Deflection

1 0 0 0

Pixel value

X-address

Y-address

1

0 0 1

0 0 0

1 1 0 0

1 1 1 0

1 1 1 0

First row, first pixel, of the screen

What if dimension of the frame buffer is differentfrom resolution of the display surface?

0

0

After right-shift

Page 52: CS 535 Intermediate Computer Graphics

53

Scan

Controller

Intensity

To

Deflection

1 0 0 0

Pixel value

X-address

Y-address

0

0 1 0

0 0 0

1 1 0 0

1 1 1 0

1 1 1 0

First row, third pixel, of the screen

What if dimension of the frame buffer is differentfrom resolution of the display surface?

1

0

After right-shift

Page 53: CS 535 Intermediate Computer Graphics

54

Scan

Controller

Intensity

To

Deflection

1 0 0 0

Pixel value

X-address

Y-address

0

0 1 1

0 0 0

1 1 0 0

1 1 1 0

1 1 1 0

First row, fourth pixel, of the screen

What if dimension of the frame buffer is differentfrom resolution of the display surface?

1

0

After right-shift

Page 54: CS 535 Intermediate Computer Graphics

55

Scan

Controller

Intensity

To

Deflection

1 0 0 0

Pixel value

X-address

Y-address

1

0 0 0

0 0 1

1 1 0 0

1 1 1 0

1 1 1 0

Second row, first pixel, of the screen

What if dimension of the frame buffer is differentfrom resolution of the display surface?

0

0

After right-shift

Page 55: CS 535 Intermediate Computer Graphics

56

Scan

Controller

Intensity

To

Deflection

1 0 0 0

Pixel value

X-address

Y-address

1

0 0 1

0 0 1

1 1 0 0

1 1 1 0

1 1 1 0

Second row, 2nd pixel, of the screen

What if dimension of the frame buffer is differentfrom resolution of the display surface?

0

0

After right-shift

Page 56: CS 535 Intermediate Computer Graphics

57

Scan

Controller

Intensity

To

Deflection

1 0 0 0

Pixel value

X-address

Y-address

0

0 1 0

0 0 1

1 1 0 0

1 1 1 0

1 1 1 0

Second row, 3rd pixel, of the screen

What if dimension of the frame buffer is differentfrom resolution of the display surface?

1

0

After right-shift

Page 57: CS 535 Intermediate Computer Graphics

58

Scan

Controller

Intensity

To

Deflection

1 0 0 0

Pixel value

X-address

Y-address

0

0 1 1

0 0 1

1 1 0 0

1 1 1 0

1 1 1 0

Second row, 4th pixel, of the screen

What if dimension of the frame buffer is differentfrom resolution of the display surface?

1

0

After right-shift

Page 58: CS 535 Intermediate Computer Graphics

CS Dept, UK59

1.6 Shadow Mask Color Monitor

Shadow mask

Screen

Blue gun

Green gun

Red gun

Red

Green

Blue

Page 59: CS 535 Intermediate Computer Graphics

CS Dept, UK60

Shadow Mask Color Monitor

⚫ phospher dots (red, green, blue) are arranged in triangular pattern called triad (or, pixel)

⚫ three electron guns are used

⚫ A shadow mask, behind the view surface, is equipped so that each small hole for each triad (holes are aligned so that each electron gun excites its corresponding phospher dot)

⚫ resolution of these monitors is limited- (high resolution: triads are on about .21mm centers)

- (home TV: triads are on about .60mm centers)

Page 60: CS 535 Intermediate Computer Graphics

CS Dept, UK61

Scan

Controller

Frame Buffer

1.7 Display with Lookup Table (LUT)

CRT

Screen

X address

Y address

0 0 0

0 1 1To

Deflection

LUT

R G B12 bits(x0, y0)

(x0, y0)

Shadow mask CRT

Page 61: CS 535 Intermediate Computer Graphics

CS Dept, UK62

Display with Lookup Table (LUT)

⚫ each number stored in frame buffer is an

index (address) into a lookup table (color

table or color map)

⚫ Lookup table provides significant saving on

memory while gives the ability to change

colors from picture to picture

Page 62: CS 535 Intermediate Computer Graphics

CS Dept, UK63

1.8 Flat-Panel Displays

⚫ Liquid-crystal display (LCD)

⚫ Active matrix panel (AMP)

⚫ Plasma panel

Page 63: CS 535 Intermediate Computer Graphics

CS Dept, UK64

ReflectiveLiquid-crystal display (LCD)

View

direction

Reflective

layer

Horizontal

polarizerHorizontal

grid wires

Liquid-

crystal

layer

Vertical

polarizer

Vertical

grid wires

Without Backlight module

Page 64: CS 535 Intermediate Computer Graphics

CS Dept, UK65

ReflectiveLiquid-crystal display (LCD)

Horizontal

polarizerHorizontal

grid wires

Liquid-

crystal

layer

Vertical

polarizer

Vertical

grid wires

With polarizing effect

Reflective

layer

Page 65: CS 535 Intermediate Computer Graphics

CS Dept, UK66

ReflectiveLiquid-crystal display (LCD)

Reflective

layer

Horizontal

polarizerHorizontal

grid wires

Liquid-

crystal

layer

Vertical

polarizer

Vertical

grid wires

With polarizing effect

Page 66: CS 535 Intermediate Computer Graphics

CS Dept, UK67

ReflectiveLiquid-crystal display (LCD)

Reflective

layer

Horizontal

polarizerHorizontal

grid wires

Liquid-

crystal

layer

Vertical

polarizer

Vertical

grid wires

Without polarizing effect

noth

ing

Page 67: CS 535 Intermediate Computer Graphics

CS Dept, UK68

ReflectiveLiquid-crystal display (LCD)

Reflective

layer

Horizontal

polarizerHorizontal

grid wires

Liquid-

crystal

layer

Vertical

polarizer

Vertical

grid wires

Without polarizing effect

noth

ing

Page 68: CS 535 Intermediate Computer Graphics

CS Dept, UK69

⚫ Six layers (see the above figure)

⚫ Liquid-crystal is made up of long crystalline molecules arranged in a spiral fashion

⚫ Direction of polarization of polarized light passing through is rotated 90 degrees

⚫ The crystals line up in the same direction when in an electric field, therefore no polarizing effect

ReflectiveLiquid-crystal display (LCD)

Page 69: CS 535 Intermediate Computer Graphics

CS Dept, UK70

⚫ In this case the light passing through the liquid-

crystal layer will be absorbed by the rear polarizer,

so the viewer sees a dark spot on the display

⚫ To create a dark spot at (x1, y1), use matrix

addressing: applying a negative voltage −V to the

vertical grid wire x1 and a positive voltage +V to

the horizontal grid wire y1 to create an electric

field at (x1, y1).

ReflectiveLiquid-crystal display (LCD)

x1

y1

Page 70: CS 535 Intermediate Computer Graphics

CS Dept, UK71

⚫ To display dots at (x1, y1) and (x2, y2), cannot

simply apply negative voltage to x1 and x2 and

positive voltage to y1 and y2: that would cause

dots to appear at (x1, y1), (x1, y2), (x2, y1) and

(x2, y2). We have to activate them one at a time.

The display is refreshed one row at a time.

ReflectiveLiquid-crystal display (LCD)

Page 71: CS 535 Intermediate Computer Graphics

CS Dept, UK72

How an image is created on a reflective LCD?

x0 x1 x2 x7x3 x4 x6x5

y0

y1

y2

y3

y4

y5

y6

y7

_

+

Page 72: CS 535 Intermediate Computer Graphics

CS Dept, UK73

First row:

x0 x1 x2 x7x3 x4 x6x5

y0

y1

y2

y3

y4

y5

y6

y7

_

+

_

Page 73: CS 535 Intermediate Computer Graphics

CS Dept, UK74

Second row:

x0 x1 x2 x7x3 x4 x6x5

y0

y1

y2

y3

y4

y5

y6

y7

_

+

_

Page 74: CS 535 Intermediate Computer Graphics

CS Dept, UK75

Last row:

x0 x1 x2 x7x3 x4 x6x5

y0

y1

y2

y3

y4

y5

y6

y7

Page 75: CS 535 Intermediate Computer Graphics

CS Dept, UK76

Transmissive LCD (single pixel)

Page 76: CS 535 Intermediate Computer Graphics

CS Dept, UK77

Color Transmissive LCD (single pixel w/ rgb sub)

Page 77: CS 535 Intermediate Computer Graphics

CS Dept, UK78

TransmissiveLiquid-crystal display (LCD)

Reflective

layer

Horizontal

polarizerHorizontal

grid wires

Liquid-

crystal

layer

Vertical

polarizer

Vertical

grid wires

With polarizing effect

Back-

light

sourceBright

spot

Page 78: CS 535 Intermediate Computer Graphics

CS Dept, UK79

TransmissiveLiquid-crystal display (LCD)

Reflective

layer

Horizontal

polarizerHorizontal

grid wires

Liquid-

crystal

layer

Vertical

polarizer

Vertical

grid wires

Without polarizing effect

Back-

light

sourcedark

spot

nothing

Page 79: CS 535 Intermediate Computer Graphics

CS Dept, UK80

Active Matrix Panel (TFT LCD)

⚫ LCD panel with a thin-film transistor (TFT) at

each grid point

⚫ Transistor can hold the cell in "adjusted"

state until changed

⚫ The display need not be refreshed and is

brighter

Page 80: CS 535 Intermediate Computer Graphics

CS Dept, UK81

Color Transmissive LCD (single pixel w/ rgb sub)

Page 81: CS 535 Intermediate Computer Graphics

CS Dept, UK82

Plasma Panel

⚫ Similar to the center part of the previous

figure

⚫ Array of tiny neon bulbs

⚫ Need not be refreshed

Page 82: CS 535 Intermediate Computer Graphics

CS Dept, UK83

1.9 Input Devices

⚫ Logical Classes of devices and techniques

Logical Device Function Physical device

Keyboard Input character string Alphnumeric keyboard

Locator Indicate a position

and/or orientation

Tablet, mouse,

joystick

Pick Select a displayed entity Light pen

Choice Select from a set of

actions or choicesPFK, mouse

Dial (Valuator) Input an analog

value (number)

Slidebar,

potentiometer

Page 83: CS 535 Intermediate Computer Graphics

CS Dept, UK84

Mouse – most commonly used

Page 84: CS 535 Intermediate Computer Graphics

CS Dept, UK85

Mouse – most commonly used

⚫ using mechanical detector or optical detector to

measure motion

⚫ mechanical mice measure distance by turning a

ball (at the bottom) and consequently a pair of

encoders. The encoders measure motion in two

directions.

⚫ old optical mice measure distance traveled by

counting lines on a special pad

Page 85: CS 535 Intermediate Computer Graphics

CS Dept, UK86

Mouse – most commonly used

⚫ modern surface-independent optical mice work

by using an optoelectronic sensor (essentially, a

tiny low-resolution video camera) to take

successive images of the surface on which the

mouse operates.

⚫ the surface is lit at a grazing angle by a light

emitting diode (LED).

Page 86: CS 535 Intermediate Computer Graphics

CS Dept, UK87

Mouse – most commonly used

Page 87: CS 535 Intermediate Computer Graphics

CS Dept, UK88

Mouse – most commonly used

⚫ the purpose is for the texture of the surface to

cast shadows on the surface itself, like the

situation of a hilly terrain lit at sunset.

⚫ images taken of the surface are then compared

to determine how far the mouse has moved.

⚫ the displacement information is then sent to the

computer to update the location of the mouse

cursor.

Page 88: CS 535 Intermediate Computer Graphics

CS Dept, UK89

Shadow 1

Light

source at

location 1

Light

source at

location 2

Shadow 2

c

dIf I know the value of ‘c’

then based on similar

triangle property, I can

compute ‘d’

ground

Page 89: CS 535 Intermediate Computer Graphics

CS Dept, UK90

Mouse – most commonly used

⚫ a relative device, has no absolute origin, report

only changes from their former position

⚫ the application program can reposition the cursor

anywhere on the screen

Page 90: CS 535 Intermediate Computer Graphics

CS Dept, UK91

1.10 Input Modes

⚫ Defined by the relationship between the measure

process and the trigger

– Measure: what the device returns to the user program

– Trigger: a physical action on the device

⚫ The display processing unit contains a number of

registers (buffers). Once initialized, input devices

store appropriate values in these registers

Page 91: CS 535 Intermediate Computer Graphics

CS Dept, UK92

Scan

Controller

Frame Buffer

Intensity

To

Grid wires

Image Display System (a simple two-color

raster –scan system)

1 0 1 1 0 0 1 1

Pixel value

X-address

Y-address

1

0 0 0

0 1 1

··· ···

Input device

Input device

Input device

···

Page 92: CS 535 Intermediate Computer Graphics

CS Dept, UK93

Input modes

⚫ Request mode: application program requests

input from a device, the graphics user interface

returns control and the measure of the device

only after the user has triggered the device

⚫ Used with only one device at a time

⚫ Application program cannot provide dynamic

feedback, because application program does not

regain control until the trigger action occurs

Page 93: CS 535 Intermediate Computer Graphics

CS Dept, UK94

Input modes

⚫ Sample mode: a single device is sampled, and the

measure of the device is immediately returned. No

trigger is needed

⚫ Sequence of user inputs might be lost in sampling.

Why?

⚫ Well-suited for dynamic feedback from the

application program

Page 94: CS 535 Intermediate Computer Graphics

CS Dept, UK95

Input modes

⚫ Event mode: when a device is triggered, the device

measure with the identifier for the deivce is placed in

an "event queue“ (but application program is not

interrupted)

⚫ Application program first enables all devices whose

use is to be permitted

⚫ Once enabled, a trigger action for any of them

places an event report in an input queue, in order of

occurrence

Page 95: CS 535 Intermediate Computer Graphics

CS Dept, UK96

Input modes: event mode

- more natural mode for systems with several independent processes and

shared input devices

- typical for a graphical user interface (GUI) and is supported by the library.

- handles both hardware interrupts and software interrupts

Events

GUI

Application

Program

Process

event type 1

Process

event type 2

Process

event type 3

Examine events,

Call processing

module

Page 96: CS 535 Intermediate Computer Graphics

CS Dept, UK97

1.11 Clients and Servers

⚫ Primary motivation for the development of X Window

System:

"do graphics over a network“

⚫ In a world of distributed computing and networks, building

blocks are entities called "server"

Printer Server Client Client

File Server Computer Server Client

(Server: remote machine supporting client workstations)

Page 97: CS 535 Intermediate Computer Graphics

CS Dept, UK98

Clients and Servers

However, for X Window System & OpenGL

⚫ Server: device that displays the graphics

(machine in front of the user)

⚫ Client: device that does computation (whatever

machine running the application)

Page 98: CS 535 Intermediate Computer Graphics

CS Dept, UK99

Concept of X Server

Then (Vector Display Device):

Input DevicesDisplay file

DisplayHost (CPU)

DPU

Page 99: CS 535 Intermediate Computer Graphics

CS Dept, UK

10

0

Concept of X Server

Now

Server

File ServerClient

X Protocol

X Protocol

Input devices

CPU

Display file

Display

device

Page 100: CS 535 Intermediate Computer Graphics

End

CS Dept, UK

10

1

Page 101: CS 535 Intermediate Computer Graphics

8/31/2021

10

4

Class website:

http://www.cs.uky.edu/~cheng/

http://www.cs.uky.edu/~cheng/cs535/CS535-

HomePage-2019f.htm

Page 102: CS 535 Intermediate Computer Graphics

CS Dept, UK

11

0

1/60 sec 1/60 sec 1/60 sec

Refresh time Fly-back time