CG Unit 1
CG Unit 1
COMPUTER GRAPHICS
UNIT I
Introduction
The term computer graphics includes almost everything on computers that is not text
or sound. Today almost every computer can do some graphics, and people have even come to
expect to control their computer through icons and pictures rather than just by typing. Here in
our lab at the Program of Computer Graphics, we think of computer graphics as drawing
pictures on computers, also called rendering. The pictures can be photographs, drawings,
movies, or simulations - pictures of things, which do not yet exist and maybe could never
exist. Or they may be pictures from places we cannot see directly, such as medical images
from inside your body. We spend much of our time improving the way computer pictures can
simulate real world scenes. We want images on computers to not just look more realistic, but
also to be more realistic in their colors, the way objects and rooms are lighted, and the way
different materials appear. We call this work ―realistic image synthesis‖.
Interactive Graphics
In interactive computer graphics user have some control over the picture i.e user can
make any change in the produced image. One example of it is the ping pong game. The
conceptual model of any interactive graphics system is given in the picture shown in Figure
At the hardware level (not shown in picture), a computer receives input from
interaction devices, and outputs images to a display device. The software has three
components. The first is the application program, it creates, stores into, and retrieves
from the second component, the application model, which represents the the graphic
primitive to be shown on the screen. The application program also handles user input.
It produces views by sending to the third component, the graphics system, a series of
graphics output commands that contain both a detailed geometric description of what
is to be viewed and the attributes describing how the objects should appear. After the
user input is processed, it sent to the graphics system is for actually producing the
picture. Thus the graphics system is a layer in between the application program and
the display hardware that effects an output transformation from objects in the
application model to a view of the model.
2
Application
Application Program Graphics
Model system
The objective of the application model is to captures all the data, objects, and
relationships among them that are relevant to the display and interaction part of the
application program and to any nongraphical postprocessing modules.
Passive Graphics
Graphics provides one of the most natural means of communicating with a computer,
since our highly developed 2D and 3D pattern-recognition abilities allow us to perceive and
process pictorial data rapidly and efficiently. In Many design, implementation, and
construction processes today, the information pictures can give is virtually indispensable.
Scientific visualization became an important field in the late 1980s, when scientists and
engineers realized that they could not interpret the data and prodigious quantities of data
produced in supercomputer runs without summarizing the data and highlighting trends and
phenomena in various kinds of graphical representations.
Creating and reproducing pictures, however, presented technical problems that stood
in the way of their widespread use. Thus, the ancient Chinese proverb ―a picture is worth ten
thousand words‖ became a cliché in our society only after the advent of inexpensive and
simple technology for producing pictures—first the printing press, then photography.
3
Interactive computer graphics is the most important means of producing pictures since
the invention of photography and television; it has the added advantage that, with the
computer, we can make pictures not only of concrete, ―real-world‖ objects but also of
abstract, synthetic objects, such as mathematical surfaces in 4D and of data that have no
inherent geometry, such as survey results. Furthermore, we are not confined to static images.
Although static pictures are a good means of communicating information, dynamically
varying pictures are frequently even better–to time-varying phenomena, both real (e.g.,
growth trends, such as nuclear energy use in the United States or population movement form
cities to suburbs and back to the cities). Thus, a movie can show changes over time more
graphically than can a sequence of slides. Thus, a sequence of frames displayed on a screen
at more than 15 frames per second can convey smooth motion or changing form better than
can a jerky sequence, with several seconds between individual frames. The use of dynamics
is especially effective when the user can control the animation by adjusting the speed, the
portion of the total scene in view, the amount of detail shown, the geometric relationship of
the objects in the another, and so on. Much of interactive graphics technology therefore
contains hardware and software for user-controlled motion dynamics and update dynamics.
With motion dynamics, objects can be moved and tumbled with respect to a stationary
observer. The objects can also remain stationary and the viewer can move around them , pan
to select the portion in view, and zoom in or out for more or less detail, as though looking
through the viewfinder of a rapidly moving video camera. In many cases, both the objects
and the camera are moving. A typical example is the flight simulator, which combines a
mechanical platform supporting a mock cockpit with display screens for windows.
Computers control platform motion, gauges, and the simulated world of both stationary and
moving objects through which the pilot navigates.
Update dynamics is the actual change of the shape, color, or other properties of the
objects being viewed.. With the recent development of digital signal processing (DSP) and
audio synthesis chips, audio feedback can now be provided to augment the graphical
feedback and to make the simulated environment even more realistic.
Interactive computer graphics thus permits extensive, high-bandwidth user-computer
interaction. This significantly enhances our ability to understand data, to perceive trends, and
to visualize real or imaginary objects–indeed, to create ―virtual worlds‖ that we can explore
from arbitrary points of view. By making communication more efficient, graphics make
possible higher-quality and more precise results or products, greater productivity, and lower
analysis and design costs.
4
(2) Monitor like a TV set without the tuning and receiving electronics.
(3) Display Controller It passes the contents of the frame buffer to the monitor.
Figure 1.2
Inside the frame buffer the image is stored as a pattern of binary digital numbers, which
represent a array of picture elements, or pixels. In the simplest case, where you want to store
only black and white images, you can represent black pixels by ―1‘s‖ and white pixels by
―0‘s‖ in the frame buffer. Therefore, a array of black and white pixels of 16X16 could be
represented by 32 bytes, stored in frame buffer.
The display controller reads each successive byte of data from the frame buffer and
converts its 0‘s and 1‘s into corresponding video signals. This signal is then fed to the
monitor, producing a black and white image on the screen. The display controller repeats this
operation 30 times a second to maintain a steady picture on the monitor. If you want to
change the image, then you need to modify the frame buffer‘s contexts to represent the new
pattern of pixels.
5
Display Devices
The principle of producing images as collections of discrete points set to appropriate colours
is now widespread throughout all fields of image production. The most common graphics
output device is the video monitor which is based on the standard cathode ray tube(CRT)
design, but several other technologies exist and solid state monitors may eventually
predominate.
The focusing system in a CRT is needed to force the electron beam to converge into a
small spot as it strikes the phosphor. Otherwise, the electrons would repel each other, and the
beam would spread out as it approaches the screen. Focusing is accomplished with either
electric or magnetic fields. Electrostatic focusing is commonly used in television and
computer graphics monitors. With electrostatic focusing, the electron beam passes through a
positively charged metal cylinder that forms an electrostatic lens, as shown in Fig. 2.3.
Similar lens focusing effects can be accomplished with a magnetic field set up by a coil
mounted around the outside of the CRT envelope. Magnetic lens focusing produces the
smallest spot size on the screen and is used in special-purpose devices.
The CRT envelope, as illustrated in Fig. 2.1. Two pairs of coils are used, with the
coils in each pair mounted on opposite sides of the neck of the CRT envelope. One pair is
mounted on the top and bottom of the neck, and the other pair is mounted on opposite sides
of the neck. The magnetic field produced by each pair of coils results in a transverse
deflection force that is perpendicular both to the direction of the magnetic field and to the
direction of travel of the electron beam. Horizontal deflection is accomplished with one pair
of coils, and vertical deflection by the other pair. The proper deflection amounts are attained
by adjusting the current through the coils. When electrostatic deflection is used, two pairs of
parallel plates are mounted inside the CRT envelope. Spots of light are produced on the
screen by the transfer of the CRT beam energy to the phosphor. When the electrons in the
beam collide with the phosphor coating, they are stopped and their kinetic energy is absorbed
by the phophor. Part of the beam energy is converted by friction into heat energy, and the
remainder causes electrons in the phosphor atoms to move up to higher quanturn-energy
levels. After a short time, the "excited" phosphor electrons begin dropping back to their
stable ground state, giving up their extra energy as small quantums of light energy. What we
see on the screen is the combined effect of all the electron light emissions: a glowing spot
that quickly fades after all the excited phosphor electrons have returned to their ground
energy level. The frequency (or color) of the light emitted by the phosphor is proportional to
the energy difference between the excited quantum state and the ground state.
7
Figure 2.4 shows the intensity distribution of a spot on the screen. The intensity is greatest at
the center of the spot, and decreases with a Gaussian distribution out to the edges of the spot.
This distribution corresponds to the cross-sectional electron density distribution of the CRT
beam.
Figure 2.5: A random-scan system draws the component lines of an object in any order
specified
Refresh rate on a random-scan system depends on the number of lines to be displayed.
Picture definition is now stored as a set of line-drawing commands in an area of memory
referred to as the refresh display file. Random-scan systems are designed for line-drawing
applications and can-not display realistic shaded scenes. Since picture definition is stored as a
set of line-drawing instructions and not as a set of intensity values for all screen points,
vector displays generally have higher resolution than raster systems. Also, vector displays
produce smooth line drawings because the CRT beam directly follows the line path.
Raster-Scan Displays
In raster scan approach, the viewing screen is divided into a large number of discrete
phosphor picture elements, called pixels. The matrix of pixels constitutes the raster. The
number of separate pixels in the raster display might typically range from 256X256 to 1024X
1024. Each pixel on the screen can be made to glow with a different brightness. Colour
screen provide for the pixels to have different colours as well as brightness. 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.6). Each screen point is referred to as a
pixel or pel (shortened forms of picture element). The capability of a raster-scan system to
9
store intensity information for each screen point makes it well suited 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.
Figure 2.6: A raster-scan system displays an object as a set of discrete points across each
scan line
Intensity range for pixel positions depends on the capability of the raster system. In a
simple black-and-white system, each screen point is either on or off, so only one bit per pixel
is needed to control the intensity of screen positions. Interlacing of the scan lines in this way
allows us to see the entire screen displayed in one-half the time it would have taken to sweep
across all the lines at once from top to bottom. Interlacing is primarily used with slower
refreshing rates. On an older, 30 frame- per-second, noninterlaced display, for instance, some
flicker is noticeable. But with interlacing, each of the two passes can be accomplished in
l/60th of a second, which brings the refresh rate nearer to 60 frames per second. This is an
effective technique for avoiding flicker, providing that adjacent scan lines contain similar
display information.
The above figure Interlacing Scan lines on a raster-scan display. First , all points on the even-
numbered (solid) scan lines are displayed; then all points along the odd- numbered (dashed)
lines are displayed
10
The delta - delta shadow-mask method, commonly used in color CRT- systems. 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
beam can activate only its corresponding color dot when it passes through the shadow mask.
Three electron guns, aligned with the triangular color-dot patterns on the screen, are directed
to each dot triangle by a shadow mask.
11
the refresh CRT. Because no refreshing is needed, very complex pictures can be
displayed at very high resolutions without flicker. Disadvantages of DVST systems are that
they ordinarily do not display color and that selected parts of a picture cannot be erased. To
eliminate a picture section, the entire screen must be erased and the modified picture
redrawn. The erasing and redrawing process can take several seconds for a complex picture.
For these reasons, storage displays have been largely replaced by raster systems.
The Flat-Panel display refers to a class of video devices that have reduced volume, weight
and power requirement compare to CRT.
Example: Small T.V. monitor, calculator, pocket video games, laptop computers, an
advertisement board in elevator.
12
1. Emissive Display: The emissive displays are devices that convert electrical energy into
light. Examples are Plasma Panel, thin film electroluminescent display and LED (Light
Emitting Diodes).
2. Non-Emissive Display: The Non-Emissive displays use optical effects to convert sunlight
or light from some other source into graphics patterns. Examples are LCD (Liquid Crystal
Device).
1. Cathode: It consists of fine wires. It delivers negative voltage to gas cells. The voltage is
released along with the negative axis.
2. Anode: It also consists of line wires. It delivers positive voltage. The voltage is supplied along
positive axis.
3. Fluorescent cells: It consists of small pockets of gas liquids when the voltage is applied to
this liquid (neon gas) it emits light.
4. Glass Plates: These plates act as capacitors. The voltage will be applied, the cell will glow
continuously.
The gas will slow when there is a significant voltage difference between horizontal and
vertical wires. The voltage level is kept between 90 volts to 120 volts. Plasma level does not
require refreshing. Erasing is done by reducing the voltage to 90 volts.
Each cell of plasma has two states, so cell is said to be stable. Displayable point in plasma
panel is made by the crossing of the horizontal and vertical grid. The resolution of the plasma
panel can be up to 512 * 512 pixels.
13
Advantage:
1. High Resolution
2. Large screen size is also possible.
3. Less Volume
4. Less weight
5. Flicker Free Display
Disadvantage:
1. Poor Resolution
2. Wiring requirement anode and the cathode is complex.
3. Its addressing is also complex.
Advantage:
Low power consumption.
Small Size
Low Cost
Disadvantage:
LCDs are temperature-dependent (0-70°C)
LCDs do not emit light; as a result, the image has very little contrast.
LCDs have no color capability.
The resolution is not as good as that of a CRT.
14
Input Devices
The Input Devices are the hardware that is used to transfer transfers input to the
computer. The data can be in the form of text, graphics, sound, and text. Output device
display data from the memory of the computer. Output can be text, numeric data, line,
polygon, and other objects.
1. Keyboard
2. Mouse
3. Trackball
4. Spaceball
5. Joystick
6. Light Pen
7. Digitizer
8. Touch Panels
9. Voice Recognition
10. Image Scanner
Keyboard:
The most commonly used input device is a keyboard. The data is entered by pressing the
set of keys. All keys are labeled. A keyboard with 101 keys is called a QWERTY keyboard.
The keyboard has alphabetic as well as numeric keys. Some special keys are also available.
1. Numeric Keys: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9
2. Alphabetic keys: a to z (lower case), A to Z (upper case)
3. Special Control keys: Ctrl, Shift, Alt
4. Special Symbol Keys: ; , " ? @ ~ ? :
5. Cursor Control Keys: ↑ → ← ↓
6. Function Keys: F1 F2 F3 ... F9.
7. Numeric Keyboard: It is on the right-hand side of the keyboard and used for fast entry of
numeric data.
Mouse:
A Mouse is a pointing device and used to position the pointer on the screen. It is a
small palm size box. There are two or three depression switches on the top. The movement of
the mouse along the x-axis helps in the horizontal movement of the cursor and the movement
along the y-axis helps in the vertical movement of the cursor on the screen. The mouse
cannot be used to enter text. Therefore, they are used in conjunction with a keyboard.
15
1. Inkjet Pinter
2. Laser Printer
3. Plotters Printer
4. Dot-matrix Printer and
5. Thermal Printer
Inkjet Printer: - Inkjet printers one of the user friendly computer printers. It works by
propelling variably-sized droplets of liquid or molten material (ink) onto almost any
medium. They are the most common type of printer for the general consumer due to
their low cost, high quality of output, capability of printing in glowing color, and easy to
use and handle. Ink-jet methods produce output by squirting ink in horizontal rows
across a roll of paper wrapped on a drum. The electrically charged ink stream is
deflected by an electric field to produce dot-matrix patterns.
Laser Printer: - Laser printer uses LED-technology to obtain small particles of toner
from a cartridge onto paper. They produce high quality text and graphics on plain paper.
They are generally more economical to use than the ink of inkjet printers. In a laser
device, a laser beam creates a charge distribution on a rotating drum coated with a
photoelectric material, such as selenium. Toner is applied to the drum and then
transferred to paper.
Plotters Printer: - Plotters printer are very different from others printers. Unlike other
printer Pen Plotters print by moving a pen across the surface of a piece of paper. Plotters
printer is the best way to produce color high-resolution vector-based artwork, or very
large drawings efficiently.
Dot-matrix Printer: - This printer is somehow like typewriting. They create characters
by striking pins against an ink ribbon. Each pin makes a dot, and combinations of dots
form characters and illustrations. The printing involves mechanical pressure, so these
printers can create carbon copies and carbonless copies as well.
16