computer graphics lecture 1 or 2
computer graphics lecture 1 or 2
There are certain important reasons to study computer graphics. We will discuss them
under certain heads:
Visualization
I like to see what I am doing. Many a times it happens that you perform certain tasks
which you cannot visualize; for example as a student of data structures, you implement
trees, graphs and other Abstract Data Types (ADTs) but you cannot visualize them
whereas you must be having an inner quest to see what these actually look like.
I like to show people what I am doing. Similarly at certain times you would be
performing certain tasks which you know but it would be difficult for others to
understand them so there is very important requirement of showing the things in order to
make them understandable.
Graphics is interesting
We are visual creatures and for us a picture is worth a thousand words. If we can get rid
of text based static screen and get some graphics; it’s always interesting to see things in
colours and motion on the screen. Therefore graphics is interesting because it involves
simulation, algorithm, and architecture.
Requirement
Well there are certain areas which require use of computer graphics heavily. One
example is drawing of machines. It is required to prepare drawing of a machine before the
actual production. The other heavy requirement is for architects as they have to prepare a
complete blue print of the building they have to build long before the actual construction
work gets underway. AutoCAD and other applications of the kind are heavily used today
for building architecture.
Entertainment
Merely a couple of decades back, the idea of a 24 hours Cartoons Network was really a
far fetched one. That was the time when one would wait for a whole week long before
getting an entertainment of mere 15 minutes. Well thanks to computer graphics that have
enabled us to entertain ourselves with animated movies, cartoons etc.
3
© Copyright Virtual University of Pakistan
1-Introduction to Computer Graphics VU
The term “computer graphics” was coined in 1960 by William Fetter to describe the new
design methods that he was developing at Boeing. He created a series of widely
reproduced images on a plotter exploring cockpit design using a 3D model of a human
body.
4
© Copyright Virtual University of Pakistan
1-Introduction to Computer Graphics VU
5
© Copyright Virtual University of Pakistan
1-Introduction to Computer Graphics VU
Due to rapid growth in the field of computing, now computer is used as an economical
and efficient tool for the production of pictures. Computer graphics applications are found
in almost all areas. Here we will discuss some of the important areas including:
i. User Interfaces
ii. Layout and Design
iii. Scientific Visualization and Analysis
iv. Art and Design
v. Medicine and Virtual Surgery
vi. Layout Design & Architectural Simulations
vii. History and cultural heritage
viii. Entertainment
ix. Simulations
x. Games
6
© Copyright Virtual University of Pakistan
1-Introduction to Computer Graphics VU
User Interfaces
Almost all the software packages provide a graphical interface. A major component of
graphical interface is a window manager that allows a user to display multiple windows
like areas on the screen at the same time. Each window can contain a different process
that can contain graphical or non-graphical display. In order to make a particular window
active, we simply have to click in that window using an interactive pointing device.
Graphical Interface also includes menus and icons for fast selection of programs,
processing operations or parameter values. An icon is a graphical symbol that is designed
to look like the processing option it represents.
7
© Copyright Virtual University of Pakistan
1-Introduction to Computer Graphics VU
3D Studio MAX
8
© Copyright Virtual University of Pakistan
1-Introduction to Computer Graphics VU
9
© Copyright Virtual University of Pakistan
1-Introduction to Computer Graphics VU
10
© Copyright Virtual University of Pakistan
1-Introduction to Computer Graphics VU
11
© Copyright Virtual University of Pakistan
1-Introduction to Computer Graphics VU
12
© Copyright Virtual University of Pakistan
1-Introduction to Computer Graphics VU
13
© Copyright Virtual University of Pakistan
1-Introduction to Computer Graphics VU
14
© Copyright Virtual University of Pakistan
1-Introduction to Computer Graphics VU
15
© Copyright Virtual University of Pakistan
1-Introduction to Computer Graphics VU
Movies
Computer graphics methods are now commonly used in making motions pictures, music
videos and television shows. Sometimes the graphics scenes are displayed by themselves
and sometimes graphics objects are combined with the actors and live scenes. A number
of hit movies and shows are made using computer graphics technology. Some of them
are:
Tron (1980)
First time computer graphics were used for live action sequences.
16
© Copyright Virtual University of Pakistan
1-Introduction to Computer Graphics VU
17
© Copyright Virtual University of Pakistan
1-Introduction to Computer Graphics VU
18
© Copyright Virtual University of Pakistan
1-Introduction to Computer Graphics VU
19
© Copyright Virtual University of Pakistan
1-Introduction to Computer Graphics VU
Special
Effects… in
Live Action
Cinema
20
© Copyright Virtual University of Pakistan
1-Introduction to Computer Graphics VU
“Traditional” Animated
Features…
Some examples:
• Automating Keyframing in
many Disney-type
animations
• The flocking behaviour of
the wild beast in Lion King
•Non photorealistic
rendering: 3D effects in
Futurama
21
© Copyright Virtual University of Pakistan
1-Introduction to Computer Graphics VU
22
© Copyright Virtual University of Pakistan
1-Introduction to Computer Graphics VU
Simulations
Simulation by all means is a very helpful tool to show the idea you have or the work you
are doing or to see the results of your work. Given below is the picture in which you can
see wave’s ripples on water; no doubt looking like original but is simply a simulation. A
number of software packages are used for simulation including:
Game
Thanks to computer graphics, real time games are now possible. Now game programming
itself has become an independent field and game programmers are in high demand. Some
of the famous games are:
• Quake
• Dooms
• Need For Speed
• Commandos
23
© Copyright Virtual University of Pakistan
1-Introduction to Computer Graphics VU
Related Disciplines
Data
Processing
DATA
Computer
Vision Computer
Graphics
IMAGES
Image
Processing
Interdisciplinary
Science
Physics: light, color, appearance, behavior
Mathematics: Curves and Surfaces, Geometry and Perspective
Engineering
Hardware: graphics media and processors, input and output devices
Software: graphics libraries, window systems
Art, Perception and Esthetics
Color, Composition, Lighting, Realism
24
© Copyright Virtual University of Pakistan
2-Graphics Systems I VU
The light emitted by the phosphor fades very rapidly therefore to keep the picture it is
necessary to keep the phosphor glowing. This is achieved through redrawing the picture
repeatedly by quickly directing the electron beam back over the same points and the
display using this technique is called refresh CRT.
The primary components of an electron gun in a CRT are the heated metal cathode and a
control grid. Heat is supplied to the cathode by directing a current through filament (a
coil of wire), inside the cylindrical cathode structure. Heating causes electrons to be
boiled 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.
25
© Copyright Virtual University of Pakistan
2-Graphics Systems I VU
The accelerating voltage can be generated with a positively charged metal coating on
the inside of the CRT envelope near the phosphor screen an accelerating anode can be
used.
Intensity of the electron beam is controlled by setting voltage levels on the control grid,
a metal cylinder that fits over the cathode. A high negative voltage applied to the control
grid will shut off the beam by repelling electrons and stopping them from passing through
the small hole at the end of the control grid structure. A smaller negative voltage on the
control grid simply decreases the number of electrons striking the phosphor coating on
the screen.
In electrostatic focusing the electron beam passes through a positively charged metal
cylinder that forms an electrostatic lens. Then electrostatic lens focuses the electron beam
at the center of the screen. Similar task can be achieved with a magnetic field setup 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 distance that the electron beam must travel from gun to the exact location of the
screen that is small spot is different from the distance to the center of the screen in most
CRTs because of the curvature therefore some additional focusing hardware is required
in high precision systems to take beam to all positions of the screen. This procedure is
achieved in two steps in first step beam is conveyed through the exact center of the screen
26
© Copyright Virtual University of Pakistan
2-Graphics Systems I VU
and then additional focusing system adjust the focusing according to the screen position
of the beam.
Cathode-ray tubes are now commonly constructed with magnetic deflection coils
mounted on the outside of the CRT envelope. 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 traverse
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 achieved 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. One pair of plates is
mounted horizontally to control the vertical deflection, and the other pair is mounted
vertical to control horizontal deflection.
Phosphor is available in different kinds. One variety is available in color but a major
issue is their persistence. Persistence is defined as the time it takes the emitted light from
the phosphor to decay to one-tenth of its original intensity. Lower persistence phosphors
require higher refresh rates to maintain a picture on the screen without flicker. A
phosphor with low persistence is useful for displaying highly complex, static pictures.
Monitors normally come with persistence in the range from 10 to 60 microseconds.
The maximum number of points (that can be uniquely identified) on a CRT is referred to
as the resolution. A more precise definition of resolution is the number of points per
centimeter that can be plotted horizontally and vertically, although it is often simply
stated as the total number of points in each direction.
Finally aspect ratio; is the ratio of vertical points to horizontal points necessary to
produce equal-length lines in both directions on the screen. An aspect ratio of 3/4 means
that a vertical line plotted with three points has the same length as a horizontal line
plotted with four points.
RASTER-SCAN SYSTEMS
Raster scan is the most common type of monitors using CRT. In raster scan picture is
stored in the area called refresh buffer or frame buffer. First of all why information is
stored; because picture have to be refreshed again and again for this very reason it is
stored. Second is how it is stored; so picture is stored in a two dimensional matrix where
each element corresponds to each pixel on the screen. If there arise a question what is a
pixel? The very simple answer is a pixel (short for picture element) represents the shortest
27
© Copyright Virtual University of Pakistan
2-Graphics Systems I VU
possible unique position/ element that can be displayed on the monitor without
overlapping.
The frame buffer stores information in a two dimensional matrix; the question is that how
many bits are required for each pixel or element. If there is black and white picture then
there is only one bit required to store ‘0’ for black or 1 for white and in this case buffer
will be referred as bitmap. In colour pictures obviously multiple bits are required for
each pixel position depending on the possible number of colours for example to show 256
colours 8 bits will be required for each pixel and in case if multiple bits are used for one
pixel frame buffer will be referred as pixmap.
Now with the information in frame buffer, let us see how an image is drawn. The drawing
is done in a line-by-line fashion. After drawing each line from left to right it reaches at the
left end of the next line to draw next line; which is called horizontal retrace. Similarly
after completing all lines in horizontal fashion it again reaches the top left corner to start
redrawing the image (that is for refreshing) and this is called vertical retrace. Normally
each vertical retrace takes 1/60th of a second to avoid flickering.
There are two further methods to scan the image: interlaced and non-interlaced. In
interlaced display beam completes scanning in two passes. In one pass only odd lines are
drawn and in the second pass even lines are drawn. Interlacing provides effect of double
refresh rate by completing half of the lines in half of the time. Therefore, in systems with
low refresh rates interlacing helps avoid flickering.
RANDOM-SCAN Displays
In random-scan displays a portion of the screen can be displayed. Random-scan displays
draw a picture one line at a time and are also called vector displays (or stroke-writing or
calligraphic displays). In these systems image consists of a set of line drawing commands
referred to as Refresh Display File. Random-scan can refresh the screen in any fashion
by repeating line drawing mechanism.
Random-scan displays are designed to draw all the component lines of a picture 30 to 60
times each second. High-quality vector systems are capable of handling approximately
100,000 short lines at this refresh rate. When a small set of lines is to be displayed, each
refresh cycle is delayed to avoid refresh rates greater than 60 frames per second.
Otherwise, faster refreshing of the set of lines could burn out the phosphor.
Random-scan displays are designed for line-drawing applications and cannot display
complex pictures. The lines drawn in vector displays are smoother whereas in raster-scan
lines often become jagged.
28
© Copyright Virtual University of Pakistan
2-Graphics Systems I VU
In beam penetration method two layers of phosphor, usually coated onto the inside of
the CRT screen, and the displayed colour depend on how far the electron beam penetrates
into the phosphor layers. At intermediate beam speeds, combinations of red and green
light are emitted to show two additional colours, orange and yellow. Beam penetration is
an inexpensive way to produce colours as only a few colours are possible and the quality
of picture is also not impressive.
A shadow-mask is used which has holes aligned with the dots so that each gun can fire
beam to corresponding dot only.
CRT Displays
Advantages
Fast response (high resolution possible)
Full colour (large modulation depth of E-beam)
Saturated and natural colours
Inexpensive, matured technology
Wide angle, high contrast and brightness
Disadvantages
Large and heavy (typ. 70x70 cm, 15 kg)
High power consumption (typ. 140W)
Harmful DC and AC electric and magnetic fields
Flickering at 50-80 Hz (no memory effect)
Geometrical errors at edges
Primary Gun
Flood Gun
DVST has advantage that no refresh is required so very complex pictures can be
displayed at very high resolutions without flicker. Whereas, it has disadvantage that
ordinarily no colors can be displayed 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.
Flat-Panel Displays
This is emerging technology slowly replacing CRT
monitors. The flat-panel displays have following
properties:
• Little Volume
• Light Weight
• Lesser Power consumption
The emissive displays (emitters) are devices that convert electrical energy into light.
Plasma panels, thin-film electro-luminescent displays, and light-emitting diodes are
examples of emissive displays. Non-emissive displays (non-emitters) use optical effects
to convert sunlight or light from some other
source into graphics patterns. The most
important example of a non-emissive flat-panel
display is a liquid-crystal device.
Plasma-panel Displays
Advantages
–Large viewing angle
30
© Copyright Virtual University of Pakistan
2-Graphics Systems I VU
LCD Displays
Advantages
Small footprint (approx 1/6 of CRT)
Light weight (typ. 1/5 of CRT)
Low power consumption (typ. 1/4 of CRT)
Completely flat screen - no geometrical errors
Crisp pictures - digital and uniform colours
No electromagnetic emission
Fully digital signal processing possible
Large screens (>20 inch) on desktops
Disadvantages
High price (presently 3x CRT)
Poor viewing angle (typ. +/- 50 degrees)
Low contrast and luminance (typ. 1:100)
Low luminance (Natural light) (typ. 200 cd/m2)
31
© Copyright Virtual University of Pakistan
2-Graphics Systems I VU
32
© Copyright Virtual University of Pakistan
2-Graphics Systems I VU
33
© Copyright Virtual University of Pakistan