CG Unit-1
CG Unit-1
Syllabus:
Introduction: Application areas of computer graphics,Overview of
Graphics systems, Video display devices, Raster scan systems, random scan
systems, Graphics monitors and work stations, Introduction to PHIGS
&GKS ,Input devices,input device handling algorithms.
1.1 Application Areas of Computer Graphics
1
manage rial reports, consumer information bulletins, and other types of
reports.
✔ Typical examples of presentation graphics are bar charts, line graphs,
surface graphs, pie charts, and other displays showing relationships between
multiple parameters.
Computer Art:
✔ Computer graphics methods are widely used in both fine art and
commercial art applications.
✔ Artists use a variety of computer methods, including special-purpose
hardware, artist's paintbrush (such as Lumens), other paint packages
(such as Pixelpaint and Superpaint), specially developed software,
symbolic mathematics packages (such as Mathematics), CAD packages,
desktop publishing software, and animation packages that provide
facilities for designing object shapes and specifiying object motions.
✔ Fine artists use a variety of other computer technologies to produce
images.
✔ To create pictures,the artist uses a combination of three-dimensional
modeling packages, texture mapping, drawing programs, and CAD
software.
Entertainment:
✔ Computer graphics methods am now commonly used in making motion
pictures, music videos, and television shows.
✔ Many TV series regularly employ computer graphics methods.
Education and Training:
2
✔ Models of physical systems, physiological systems, population trends, or
equipment, such as the colorcoded diagram , can help trainees to
understand the operation of the system.
✔ For some training applications, special systems are designed.
✔ Examples of such specialized systems are the simulators for practice
sessions or training of ship captains, aircraft pilots, heavy-equipment
operators, and air trafficcontrol personnel.
Visualization:
3
✔ Then digital methods can be applied to rearrange picture parts, to enhance
color separations, or to improve the quality of shading.
Graphical User Interfaces:
✔ It is common now for software packages to provide a graphical
interface.
✔ A major component of a graphical interface is a window manager that
allows a user to display multiple-window areas.
✔ Each window can contain a different process that can contain
graphical or nongraphical displays.
✔ To make a particular window active, we simply click in that window
using an interactive pointing device.Interfaces also display menus and icons
for fast selection of processing options or parameter values.
✔ An icon is a graphical symbol that is designed to look like the
processing option it represents.
1.2 Overview of grahic system and Video Display Devices:
4
✔ One way to keep the phosphor glowing is to redraw the picture
repeatedly by quickly directing the electron beam back over the same
points.
✔ This type of display is called a refresh CRT.
✔ The primary components of an electron gun in a CRT are the heated
metal cathode and a control grid shown in Fig. given below.
✔ Heat is supplied to the cathode by direcing a current through a coil of
wire, called the filament, inside the cylindrical cathode structure.
✔ This causes electrons to be 'kiled off" the hot cathode surface.
✔ In the vacuum inside the CRT envelope, the free, negatively charged
electrons are then accelerated toward the phosphor coating by a high positive
voltage.
5
✔ Electrostatic deflection of the electron beam in a CRT is shown below
6
✔ In a raster-scan system, the electron beam is swept across the screen,
one row at a time from top to bottom.
✔ As the electron beam moves across each row, the beam intensity is
turned on and off to create a pattern of illuminated spots.
✔ Picture definition is stored in a memory area called the refresh buffer
or frame buffer.
✔ This memory area holds the set of intensity values for all the screen
points.
✔ Stored intensity values are then retrieved from the refresh buffer and
"painted" on the screen one row (scan line) at a time (Fig. 2-7).
✔ Each screen point is referred to as a pixel or pel (shortened forms of
picture element).
✔ Raster scan displays suit for the realistic display of scenes containing
subtle shading and color patterns.
✔ Home television sets and printers are examples of other systems using
raster-scan methods.
✔ Refreshing on raster-scan displays is carried out at the rate of 60 to 80
frames per second, although some systems are designed for higher refresh
rates.
✔ Sometimes, refresh rates are described in units of cycles per second,
or Hertz (Hz), where a cycle corresponds to one frame.
✔ Using these units, we would describe a refresh rate of 60 frames per
second as simply 60 Hz.
7
Figure 2-7 A raster-scan system displays an object as a set of discrete
points across each scan line
8
Figure 2-9:A random-scan system draws the component lines of an object
in
any order specified.
9
✔ Random-scan displays are designed to draw all the component lines of
a picture 30 to 60 times each second.
✔ Random-scan systems are designed for line drawing applications and
cannot display realistic shaded scenes.
1.2.4 Color CRT Monitors:
10
✔ A shadow-mask CRT has three phosphor color dots at each pixel
position.
✔ One phosphor dot emits a red light, another emits a green light, and the
third emits a blue light.
✔ This type of CRT has three electron guns, one for each color dot, and a
shadow-mask grid just behind the phosphor-coated screen.
✔ The following Figure illustrates the delta-delta shadow-mask method,
commonly used in color CRT systems.
Fig: Operation of a delta-delta,shadow mask CRT.Three electron
guns,aligned with the rectangular color-dot patterns on the screen,are
directed to each dot triangle by a shadow mask.
✔ The three electron beams are deflected and focused as a group onto the
shadow mask, which contains a series of holes aligned with the
phosphor-dot patterns.
✔ When the three beams pass through a hole in the shadow mask, they
activate a dot triangle, which appears as a small color spot on the screen.
✔ The phosphor dots in the triangles are arranged so that each electron
11
beam can activate only its corresponding color dot when it passes through
the shadow mask.
12
✔ Flat-panel displays are used in small TV monitors, calculators, pocket
video games, laptop computers, arm rest viewing of movies on airlines, as
advertisement boards in elevators, and as graphics displays in applications
requiring rugged, portable monitors.
✔ Classification of flat-panel displays is shown in fig given below:
FLAT PANEL DISPLAYS
13
✔ A series of vertical conducting ribbons is placed on one glass panel,
and a set of horizontal ribbons is built into the other glass panel (Fig. 2-11).
✔ Firing voltages applied to a pair of horizontal and vertical conductors
cause the gas at the intersection of the two conductors to break down into a
glowing plasma of electrons and ions.
14
Fig2-11 Plasma Panels
15
LED:
✔ A third type of emissive device is the light-emitting diode (LED).
✔ A matrix of diodes is arranged to form the pixel positions in the display,
and picture definition is stored in a refresh buffer.
✔ As in scan-line refreshing of a CRT, information is read from the refresh
buffer and converted to voltage levels that are applied to the diodes to
produce the light patterns in the display.
LCD:
✔ Liquid – crystal displays (LCDS ) are commonly used in small
systems, such as calculators and portable, laptop computers.
✔ These nonemissive devices produce a picture by passing polarized
light from the surroundings or from an internal light source through a
liquid-crystal material that can be aligned to either block or transmit
the light.
✔ A flat-panel display can then be constructed with a nematic liquid
crystal, as emonstrated in Fig. 2-16.
✔ Two glass plates, each containing a light polarizer at right angles to
the other plate, sandwich the liquid-crystal material.
✔ Rows of horizontal transparent conductors are built into one glass
plate, and columns of vertical conductors are put into the other plate.
✔ The intersection of two conductors defines a pixel position.
✔ Normally, the molecules are aligned as shown in the "on state" of
Fig. 2-16.
✔ Polarized light passing through the material is twisted so that it will
pass through the opposite polarizer.
✔ The light is then reflected back to the viewer.
✔ To turn off the pixel, we apply a voltage to the two intersecting
conductors to align the molecules so that the light is not twisted.
16
✔ This type of flat-panel device is referred to as a passive-matrix LCD.
17
✔ These devices are called active-matrix displays.
18
1.2.8 Stereoscopic and Virtual-RealitySystems:
✔ A raster scan system employs a raster scan display for processing the
images.
✔ The following diagram clearly represents architecture of a raster scan
system.
System Video Mo
CPU
Memory Controller
System Bus
I/O Devices
Figure 2-25: Architecture of a simple raster graphics system.
19
Video Controller :
System bus
I/O Device
HOW BASIC REFRESH OPERATION IS PERFORMED BY VIDEO
CONTROLLER?
✔ In Fig. 2-28, the basic refresh operations of the video controller are
diagrammed.
✔ Two registers are used to store the coordinates of the screen pixels.
✔ Initially,the x register is set to 0 and the y register is set to ymax .
✔ The value stored in the frame buffer for this pixel position is then
retrieved and used to set the intensity of the CRT beam.
20
✔ Then the x register is incremented by 1, and the process repeated for the
next pixel on the top scan line.
✔ This procedure is repeated for each pixel along the scan line.
✔ After the last pixel on the top scan line has been processed, the x register
is reset to 0 and the y register is decremented by 1.
✔ Pixels along this scan line are then processed in turn, and the procedure
is repeated for each successive scan line.
✔ After cycling through all pixels along the bottom scan line (y = O), the
video controller resets the registers to the first pixel position on the top
scan line and the refresh process starts over.
X Y
Register Register
Pixel Register Intensit
Memory Address
Frame Buffer
Figure 2-28: Basic video-controller refresh operations.
The other operations performed by the video controller are
(1) It retrieves pixel intensities from different memory areas on different
refresh cycles.
(2) In high quality systems, for example, two frame buffers are often
provided so that one buffer can be used for refreshing while the other is
21
being filled with intensity values. Then the two buffers can switch roles.
This provides a fast mechanism-for generating real-time animations.
(3) Few transformations can be accomplished by the video controller like
enlarging the areas of the screen, reducing areas of the screen etc.
(4) In addition, the video controller often contains a lookup table, so that
pixel values in the frame buffer are used to access the lookup table instead of
controlling the CRT beam intensity directly. This provides a fast method for
changing screen intensity values.
22
(2) Generating various line styles (dashed, dotted, or solid),
(3) Displaying color areas, and
(4) Performing certain transformations and manipulations on displayed
objects.
✔ Straight lines,curved lines,polygons and other geometric objects can be
scan converted by a display processor
✔ For example,characters can be defined with rectangular grids, as in Fig.
2-30.
23
(1) ALU (Arithmetic and Logic Unit):
✔ It performs Arithmetic operations like
Addition,subtraction,multiplication and division.
✔ It also performs logical operations like AND,OR NOT etc.
(2) CU (Control unit):
✔ The control unit of a CPU controls the entire operation of the
computer.
✔ It controls all other devices such as memory, input and output devices
connected to the CPU.
✔ It controls the data flow between CPU and peripherals (including
memory)
24
Figure 2-32:Architecture of a simple random scan system.
✔ Graphics patterns are drawn on a random-scan system by directing the
electron beam along the component lines of the picture.
1.5 Graphics Monitors and WorkStations:
25
✔ For workstations specifically designed for graphics applications, typical
screen resolution is 1280 by 1024, with a screen diagonal of 16 inches or
more.
✔ Graphics workstations can be configured with from 8 to 24 bits per pixel
(full-color systems), with higher screen resolutions, faster processors, and
other options available in high-end systems.
✔ A multi screen system called the MediaWall, provides large "wall-sized”
display area.
✔ This system is designed for applications that require large area displays
in brightly lighted environments, such as at trade shows, conventions,
retail stores, museums, or passenger terminals.
✔ An array of up to 5 by 5 monitors, each with a resolution of 640 by
480, can be used in the MediaWall to provide an overall resolution of
3200 by 2400 for either static scenes or animations.
1.6 Input Devices:
26
✔ Cursor-control keys and function keys are common features on general
purpose keyboards.
✔ Function keys allow users to enter frequently used operations in a single
keystroke, and cursor-control keys can be used to select displayed
objects or coordinate positions by positioning the screen cursor.
✔ A numeric keypad is,often included on the keyboard for fast entry of
numeric data.
1.6.2 Mouse:
✔ A mouse is small hand-held box used to position the screen cursor.
✔ Wheels or rollers on the bottom of the mouse can be used to record the
amount and direction of movement.
✔ Another method for detecting mouse motion is with an optical sensor.
✔ For these systems, the mouse is moved over a special mouse pad that has
a grid of horizontal and vertical lines.
✔ The optical sensor detects movement across the lines in the grid.
✔ One, two, or three buttons usually included on the top of the mouse for
signaling the execution of some operation, such as recording cursor
position or invoking a function.
✔ The Z-mouse includes three buttons,
(1) a thumbwheel on the side,
(2) a trackball on the top, and a
(3) standard mouse ball underneath.
✔ This design provides six degrees of freedom to select spatial positions,
rotations, and other parameters.
✔ With the Z mouse, we can pick up an object, rotate it, and move it in any
direction, or we can navigate our viewing position and orientation
through a three dimensional scene.
27
✔ Applications of the Z mouse include virtuarl re ality, CAD, and
animation.
✔ As the name implies, a trackball is a ball that can be rotated with the
fingers or palm of the hand, to produce screen-cursor movement.
✔ Potentiometers, attached to the ball, measure the amount and direction of
rotation.
✔ Trackballs are often mounted on keyboards or other devices such as the
Z mouse.
✔ While a trackball is a two-dimensional positioning device, a spaceball
provides six degrees of freedom.
✔ The following diagram represents block diagram of a track ball
28
✔ Spaceballs are used for three-dimensional positioning and selection
operations in virtual-reality systems, modeling, animation, CAD, and
other applications.
1.6.4 Joy Sticks:
✔ The distance that the stick is moved in any direction from its center position
corresponds to screen-cursor movement in that direction.
✔ Potentiomters mounted at the base of the joystick measure the amount of
movement, and springs return the stick to the center position when it is
released.
✔ In another type of movable joystick, the stick is used to activate switches
that cause the screen cursor to move at a constant rate in the direction
selected.
29
✔ Eight switches, arranged in a circle, are sometimes provided, so that the stick
can select any one of eight directions for cursor movement.
✔ Pressure sensitive joysticks, also called isometric joysticks, have a
nonmovable stick.
✔ Pressure on the stick is measured with strain gauges and converted to
movement of the cursor in the direction specified.
30
✔ Typically, a digitizer is used to scan over a drawing or object and to input a
set of discrete coordinate positions, which can be joined with straight-line
segments to approximate the curve or surface shapes.
✔ One type of digitizer is the graphics tablet (also referred to as a data tablet),
which is used to input two-dimensional coordinates by activating a hand
cursor or stylus at selected positions on a flat surface.
✔ A hand cursor contains cross hairs for sighting positions, while a stylus is a
pencil-shaped device that is pointed at positions on the tablet.
31
✔ We can also apply various image-processing methods to modify the
array representation of the picture.
✔ For scanned text input, various editing operations can be performed on
the stored documents.
32
13 Touching the screen causes part of each wave to be reflected from the
finger to the emitters.
14 The screen position at the point of contact is calculated from a
measurement of the time interval between the transmission of each wave
and its reflection to the emitter.
1.6.9 Light pens:
✔ Light pens are pencil-shaped devices used to select screen positions by
detecting the light coming from points on the CRT screen.
✔ They are sensitive to the short burst of light emitted from the phosphor
coating at the instant the electron beam strikes a particular point.
✔ An activated light pen, pointed at a spot on the screen as the electron
beam lights up that spot, generates an electrical pulse that causes the
coordinate position of the electron beam to be recorded.
Fig: Light pen
33
(3) Also, light pens require special implementations for some applications
because they cannot detect positions within black areas.
(4) Light pens, sometimes give false readings due to background lighting in
a room.
1.6.10 Voice Systems:
✔ GKS (Graphics Kernel System) was adopted as the first graphics software
standard by the International Standards Organization(ISO) and American
National Standards Institute (ANSI).
✔ Although GKS was originally designed as a two-dimensional graphics
package, a three-dimensional GKS extension was subsequently developed.
34
✔ The second software standard to be developed and approved by the
standards organizations was PHIGS (Programmer's Hierarchical Interactive
Graphics standard), which is an extension of GKS.
✔ Increased capabilities for object modeling, color specifications, surface
rendering, and picture manipulations are provided in PHIGS.
✔ Subsequently, an extension of PHIGS, called PHIGS+, was developed to
provide three-dimensional surface-shading capabilities not available in
PHIGS.
✔ Graphics software can be roughly classified as applications packages
or programming packages.
✔ Applications graphics software include CAD packages, drawing and
painting programs, graphing packages, and visualization programs.
✔ Common graphics programming packages include PHIGS, PHIGS+,
GKS,3D GKS, and GL(Graphics Library).
✔ Software standards, such as PHIGS, GKS, CGI (Computer Graphics
Interface), and CGM (Computer Graphics Metafile), are evolving and are
becoming widely available on a variety of machines.
✔ PHIGS and GKS, use the concept of a "workstation" to specify
devices or software that are to be used for input or output in a particular
application.
✔ A workstation identifier in these systems can refer to a file; a single
device, such as a raster monitor; or a combination of devices, such as a
monitor, keyboard, and a mouse.
✔ Multiple workstations can be open to provide input or to receive
output in a graphics application.
✔ PHIGS stands for Programmers Hierarchical Interactive Graphics
Standard.
✔ The term work station refers to a computer system with a combination of
35
input and output devices that is designed for a single user.
✔ In PHIGS and GKS (Graphics Kernel System),however, the term
workstation is used to identify various combinations of graphics
hardware and software.
✔ A PHIGS workstation can be a single output device, a single input
device, a combination of input and output devices, a file, or even a
window displayed on a video monitor.
✔ To define and use various "workstations" within an applications program,
we need to specify a workstation identifier and the workstation type.
✔ The following statements give the general structure of a PHlGS program:
openPhigs (errorFile, memorySize)
openWorkstation (ws, connection, type)
{
create and display picture
}
closeWorkstation (ws)
closePhigs
✔ The parameter errorFile is to contain any error messages that are
generated,and parameter memorySize specifies the size of an internal
storage area.
✔ The workstation identifier (an integer) is given in parameter ws, and
parameter connection states the access mechanism for the workstation.
✔ Parameter type specifies the particular category for the workstation, such
as an input device, an output device, a combination outin device, or an
input or output metafile.
1.8 INPUT DEVICE HANDLING ALGORITHMS
There are some general forms of routines to handle input devices.Here we
consider five classes of devices-----
36
(1) Button: It is an event driven device that sends an interrupt when it is
pressed.It sends no information other than the fact that it has been
pressed.
(2) Pick: It is typified by light pen. It is an event driven device which
selects some portion of the display.
(3) Keyboard: For the keyboard simulation,the internal form of routines
are substantially altered from that of general case.This is due to two
reasons---
(a) Input from a keyboard via a higher level Language(HLL) appears
to be sampled rather than event-driven mechanism.
(b)Input is in decimal form while our computers operate on HEX
numbers.
(4) Locator: It is a sampled device that returns the coordinates of some
position.
(5) Valuator: It is a sampled device as our locator but it returns only one
value. It might be a dial or knob which can be set by the user.
✔ The above five classes are given numbers as 1,2,3,4 and 5
respectively.
✔ All these devices may be turned ON or OFF using some routines.
✔ Two basic routines are used to enable or disable each device.
✔ For example to enable a BUTTON class we write
If(B class==1)
{
// Allow to do all operations.
Button=TRUE;
}
✔ Similarly,to disable button class we write
If(B class==1)
37
{
// Perform all operations to prohibit
//input from the button device
Button=FLASE;
}
38