1
Syllabus
BCA203: Computer Graphics
Unit-1 Introduction to computer graphics:
Types of computer graphics, Graphic Displays- Random scan displays, Raster scan
displays, Color CRT, Flat panel displays, Frame buffer and video controller, interactive
input and output devices.
2
COMPUTER GRAPHICS -
FUNDAMENTALS
Unit Structure
1.0 Objectives
1.1 Introduction
1.2 Introduction to Image and Objects
1.3 Image Representation
1.4 Basic Graphics Pipeline
1.5 Bitmap and Vector-Based Graphics
1.6 Applications of Computer Graphics
1.7 Display Devices
1.7.1 Cathode Ray Tubes
1.7.2 Raster-Scan Display
1.7.3 Random-Scan Display
1.7.4 Flat Panel Display
1.8 Input Technology
1.9 Coordinate System Overview
1.10 Let us sum up
1.4 References and Suggested Reading
1.5 Exercise
1.0 OBJECTIVES
The objective of this chapter is
To understand the basics of computer graphics.
To be aware of applications of computer graphics.
To know the elements of computer graphics.
1.1 INTRODUCTION
Computer graphics involves display, manipulation and
storage of pictures and experimental data for proper visualization
using a computer. It provides methods for producing images and
animations (sequence of images). It deals with the hardware as
well as software support for generating images.
3
Basically, there are four major operations that we perform in
computer graphics:
Imaging: refers to the representation of 2D images.
Modeling: refers to the representation of 3D images.
Rendering: refers to the generation of 2D images from 3D
models.
Animation: refers to the simulation of sequence of images over
time.
1.2 INTRODUCTION TO IMAGE AND OBJECTS
An image is basically representation of a real world object on
a computer. It can be an actual picture display, a stored page in a
video memory, or a source code generated by a program.
Mathematically, an image is a two - dimensional array of data with
intensity or a color value at each element of the array.
Objects are real world entities defined in three – dimensional
world coordinates. In computer graphics we deal with both 2D and
3D descriptions of an object. We also study the algorithms and
procedures for generation and manipulation of objects and images
in computer graphics.
Check your Progress:
1. Define image and object.
2. How an image is represented mathematically?
1.3 IMAGE REPRESENTATION
Image representation is the approximations of the real world
displayed in a computer. A picture in computer graphics is
represented as a collection of discrete picture elements termed as
pixels. A pixel is the smallest element of picture or object that can
be represented on the screen of a device like computer.
4
Check your progress:
1. Define pixel.
1.4 BASIC GRAPHIC PIPELINE
In computer graphics, the graphics pipeline refers to a series
of interconnected stages through which data and commands
related to a scene go through during rendering process.
It takes us from the mathematical description of an object to
its representation on the device.
The figure shown below illustrates a 3D graphic pipeline.
Figure 1.1: A 3D graphic pipeline
5
The real world objects are represented in world coordinate
system. It is then projected onto a view plane. The projection is
done from the viewpoint of the position of a camera or eye. There is
an associated camera coordinate system whose z axis specifies
the view direction when viewed from the viewpoint. The infinite
volume swept by the rays emerging from the viewpoint and passing
through the window is called as view volume or view pyramid.
Clipping planes (near and far) are used to limit the output of the
object.
The mapping of an object to a graphic device requires the
transformation of view plane coordinates to physical device
coordinates. There are two steps involved in this process.
(i) The window to a viewport transformation. The viewport is
basically a sub – rectangle of a fixed rectangle known as
logical screen.
(ii) The transformation of logical screen coordinates to physical
device coordinates.
Transform into Clip against Project to view Transform to
camera view volume plane viewport
coordinates
Representation Transform to
of 3D world physical device
objects coordinates
Figure : Sequence of transformation in viewing pipeline
Representation Clip against Transport to Transform to
of 2D world window viewport physical device
objects coordinates
Figure 1.2: 2D coordinate system to physical device
coordinates transformation.
The figures above depict the graphic pipeline and the 2D
coordinate transformation to physical device coordinates.
6
Check your Progress:
1. Differentiate between world coordinates system and camera
coordinate system.
2. Define view volume.
1.5 BITMAP AND VECTOR – BASED GRAPHICS
Computer graphics can be classified into two categories:
Raster or Bitmap graphics and Vector graphics.
Bitmap graphics:
It is pixel based graphics.
The position and color information about the image are
stored in pixels arranged in grid pattern.
The Image size is determined on the basis of image
resolution.
These images cannot be scaled easily.
Bitmap images are used to represent photorealistic images
which involve complex color variations.
Figure 1.3
(a) An arrow image (b) magnified arrow image with pixel grid
The above figure shows a bitmap arrow image in its actual
size and magnified image with pixel grid.
Vector graphics:
The images in vector graphics are basically mathematically
based images.
Vector based images have smooth edges and therefore used to
create curves and shapes.
7
Figure 1.4
(a) A rose image (b) vector description of leaf of rose
These images are appropriate for precise illustrations but not
good for photorealistic images.
These images are easily scalable due to their mathematical
structure. Figure 1.4(a) and (b) shows a rose image and vector
description of leaf of rose.
Figure 1.5 (a) A bitmap image (b) a vector image
The above figure shows a bitmap and vector image of the letter A.
Check your Progress:
1. Which graphic system is better for photorealistic images?
2. In which graphic system images are easily scalable?
8
1.6 APPLICATIONS OF COMPUTER GRAPHICS
Computer graphics finds its application in various areas; some of
the important areas are discussed below:
Computer-Aided Design: In engineering and architectural
systems, the products are modeled using computer graphics
commonly referred as CAD (Computer Aided Design).
In many design applications like automobiles, aircraft,
spacecraft, etc., objects are modeled in a wireframe outline that
helps the designer to observe the overall shape and internal
features of the objects.
CAD applications are also used in computer animations. The
motion of an object can be simulated using CAD.
Presentation graphics: In applications like summarizing of
data of financial, statistical, mathematical, scientific and
economic research reports, presentation graphics are used. It
increases the understanding using visual tools like bar charts,
line graphs, pie charts and other displays.
Computer Art: A variety of computer methods are available for
artists for designing and specifying motions of an object. The
object can be painted electronically on a graphic tablet using
stylus with different brush strokes, brush widths and colors. The
artists can also use combination of 3D modeling packages,
texture mapping, drawing programs and CAD software to paint
and visualize any object.
Entertainment: In making motion pictures, music videos and
television shows, computer graphics methods are widely used.
Graphics objects can be combined with live actions or can be
used with image processing techniques to transform one object
to another (morphing).
Education and training: Computer graphics can make us
understand the functioning of a system in a better way. In
physical systems, biological systems, population trends, etc.,
models makes it easier to understand.
In some training systems, graphical models with simulations
help a trainee to train in virtual reality environment. For
example, practice session or training of ship captains, aircraft
pilots, air traffic control personnel.
9
Visualization: For analyzing scientific, engineering, medical
and business data or behavior where we have to deal with large
amount of information, it is very tedious and ineffective process
to determine trends and relationships among them. But if it is
converted into visual form, it becomes easier to understand.
This process is termed as visualization.
Image processing: Image processing provides us techniques
to modify or interpret existing images. One can improve picture
quality through image processing techniques and can also be
used for machine perception of visual information in robotics.
In medical applications, image processing techniques can be
applied for image enhancements and is been widely used for
CT (Computer X-ray Tomography) and PET (Position Emission
Tomography) images.
Graphical User Interface: GUI commonly used these days to
make a software package more interactive. There are multiple
window system, icons, menus, which allows a computer setup
to be utilized more efficiently.
Check your progress:
1. Fill in the blanks
(a) GUI stands for.................
(b) ............ provides us techniques to modify or interpret existing
images.
2. Explain how computer graphics are useful in entertainment
industry.
1.7 DISPLAY DEVICES
There are various types of displays like CRT, LCD and
Plasma. We will discuss each of these three in brief.
10
CRT (Cathode Ray Tube) is one of the mostly used display
technology. In CRT, a beam of electrons emitted by an electron
gun strikes on specified positions on phosphor coated screen
after passing through focusing and deflecting systems.
Figure 1.6 : Elements of CRT
LCD Display: LCD stands for Liquid Crystal Display
o Organic molecules that remain in crystalline structure without
external force, but re-aligns themselves like liquid under
external force
o So LCDs realigns themselves to EM field and changes their own
polarizations
Figure 1.7 : LCD display
11
o There are two types of LCD displays:
o Active Matrix LCD:
Electric field is retained by a capacitor so that the crystal
remains in a constant state.
Transistor switches are used to transfer charge into the
capacitors during scanning.
The capacitors can hold the charge for significantly longer than
the refresh period
Crisp display with no shadows.
More expensive to produce.
o Passive matrix LCD:
LCD slowly transit between states.
In scanned displays, with a large number of pixels, the
percentage of the time that LCDs are excited is very small.
Crystals spend most of their time in intermediate states, being
neither "On" or "Off".
These displays are not very sharp and are prone to ghosting.
Plasma display:
Figure1.8 (showing the basic structure of plasma display)
o These are basically fluorescent tubes.
o High- voltage discharge excites gas mixture (He, Xe), upon
relaxation UV light is emitted, UV light excites phosphors.
o Some of its features are
Large view angle
Large format display
Less efficient than CRT, more power
Large pixels: 1mm (0.2 mm for CRT)
Phosphors depletion
In CRT monitors there are two techniques of displaying images.
12
o Raster scan displays: A rectangular array of points or [Link] a
raster scan system, the electron beam is swept across the
screen, one row at a time from top to [Link] the electron
beam moves across each row, the beam intensity is turned on
and off to create a pattern of illuminated spots. See the figure
below.
Figure 1.9 : Raster scan display
Horizontal retrace: The return to the left of the screen, after
refreshing each scan line.
Vertical retrace: At the end of each frame (displayed in 1/80th
to 1/60th of a second) the electron beam returns to the top left
corner of the screen to begin the next frame.
Figure 1.10 (showing horizontal and vertical retrace)
13
Random scan display: Random scan display is the use of
geometrical primitives such as points, lines, curves, and
polygons, which are all based upon mathematical equation. In a
random scan display, a CRT has the electron beam directed
only to the parts of the screen where a picture is to be drawn.
Random scan monitors draw a picture one line at a time. See
the figure below.
Figure 1.11: Random Scan display
o Refresh rate depends on the number of lines to be displayed.
o Picture definition is now stored as a line-drawing commands an
area of memory referred to as refresh display file.
o To display a picture, the system cycle through the set of
commands in the display file, drawing each component line in
turn.
o Random scan displays are designed to draw all the component
lines of a picture 30 to 60 times each second.
o Random scan displays have higher resolution than raster
systems.
There are some parameters or properties related to graphic
displays like CRT:
Persistence: In case of CRT, persistence refers to the property
of a phosphor defining its life time, i.e., how long they continue
to emit light after the CRT beam is removed.
Resolution: The maximum number of points that can be
displayed without overlap on a CRT is referred to as the
resolution. In other words, it is the number of points per unit
length that can be plotted horizontally and vertically.
14
Aspect ratio: It is the ratio of the number of vertical points to
the number of horizontal points necessary to produce equal-
length lines in both directions on the screen.
Frame buffer: Frame buffer also known as refresh buffer is the
memory area that holds the set of intensity values for all the
screen points.
Pixel: It refers a point on the screen. It is also known as pel and
is shortened form of ‘picture element’.
Bitmap or pixmap: A frame buffer is said to be bitmap on a
black and white system with one bit per pixel. For systems with
multiple bits per pixel, the frame buffer is referred to as pixmap.
Graphical images - used to add emphasis, direct attention,
illustrate concepts, and provide background content. Two types
of graphics:
o Draw-type graphics or vector graphics – represent an image as
a geometric shape
o Bitmap graphics – represents the image as an array of dots,
called pixels
Three basic elements for drawing in graphics are:
o Point: A point marks a position in space. In pure geometric
terms, a point is a pair of x, y coordinates. It has no mass at all.
Graphically, however, a point takes form as a dot, a visible
mark. A point can be an insignificant fleck of matter or a
concentrated locus of power. It can penetrate like a bullet,
pierce like a nail, or pucker like a kiss. A mass of points
becomes texture, shape, or plane. Tiny points of varying size
create shades of gray.
o Line: A line is an infinite series of points. Understood
geometrically, a line has length, but no breadth. A line is the
connection between two points, or it is the path of a moving
point. A line can be a positive mark or a negative gap. Lines
appear at the edges of objects and where two planes meet.
Graphically, lines exist in many weights; the thickness and
texture as well as the path of the mark determine its visual
presence. Lines are drawn with a pen, pencil, brush, mouse, or
digital code. They can be straight or curved, continuous or
broken. When a line reaches a certain thickness, it becomes a
plane. Lines multiply to describe volumes, planes, and textures.
o Plane: A plane is a flat surface extending in height and width. A
plane is the path of a moving line; it is a line with breadth. A line
closes to become a shape, a bounded plane. Shapes are
15
planes with edges. In vector–based software, every shape
consists of line and fill. A plane can be parallel to the picture
surface, or it can skew and recede into space. Ceilings, walls,
floors, and windows are physical planes. A plane can be solid or
perforated, opaque or transparent, textured or smooth.
Check your progress:
1. Explain different display technologies.
2. Differentiate between Raster scan and Random scan display.
1.8 INPUT TECHNOLOGY
There are different techniques for information input in
graphical system. The input can be in the form of text, graphic or
sound. Some of the commonly used input technologies are
discussed below.
1.8.1 Touch Screens
A touch screen device allows a user to operate a touch
sensitive device by simply touching the display screen. The input
can be given by a finger or passive objects like stylus. There are
three components of a touch screen device: a touch sensor, a
controller and a software driver.
A touch sensor is a touch sensitive clear glass panel. A
controller is a small PC card which establishes the connection
between a touch sensor and the PC. The software driver is a
software that allows the touch screen to work together with the PC.
The touch screen technology can be implemented in various ways
like resistive, surface acoustic, capacitive, infrared, strain gauge,
optical imaging, dispersive signal technology, acoustic pulse
recognition and frustrated total internal reflection.
1.8.2 Light pen
A light pen is pen shaped pointing device which is connected
to a visual display unit. It has light sensitive tip which detects the
light from the screen when placed against it which enables a
computer to locate the position of the pen on the screen. Users can
16
point to the image displayed on the screen and also can draw any
object on the screen similar to touch screen with more accuracy.
1.8.3 Graphic tablets
Graphic tablets allow a user to draw hand draw images and
graphics in the similar way as is drawn with a pencil and paper.
It consists of a flat surface upon which the user can draw or
trace an image with the help of a provided stylus. The image is
generally displayed on the computer monitor instead of appearing
on the tablet itself.
Check your Progress:
1. Name different types of touch screen technologies.
2. Differentiate between light pen and graphic tablet.
1.9 COORDINATE SYSTEM OVERVIEW
To define positions of points in space one requires a
coordinate system. It is way of determining the position of a point
by defining a set of numbers called as coordinates. There are
different coordinate systems for representing an object in 2D or 3D.
1.9.1 Cartesian coordinate system
It is also known as rectangular coordinate system and can
be of two or three dimensions. A point in Cartesian coordinate
system can be defined by specifying two numbers, called as x –
coordinate and the y – coordinate of that point.
17
Figure 1.12: Cartesian coordinate system
In the above figure, there are two points (2, 3) and (3, 2) are
specified in Cartesian coordinate system
1.9.2 Polar coordinate system
In polar coordinate system, the position of a point is defined by
specifying the distance (radius) from a fixed point called as origin
and the angle between the line joining the point and the origin and
the polar axis (horizontal line passing through the origin).
Figure 1.13: Polar coordinate system
The above figure shows a point (r, θ) in polar coordinates.
18
Check your Progress:
Fill in the blanks
1. The position of a point is defined by specifying the distance
(radius) from a fixed point called as ……….
2. A point in Cartesian coordinate system can be defined by
specifying two numbers, called as …….. and the .................. of
that point.
Answers: 1. Origin
2. x - coordinate, y – coordinate.
1.10 LET US SUM UP
We learnt about computer graphics, its application in
different areas. We studied various display and input technologies.
We also studied basic graphic pipeline, bitmap and vector based
graphics. Then we learnt the elements of computer graphics in
which came to know about the terms like persistence, resolution,
aspect ratio, frame buffer, pixel and bitmap. Finally we studied
about the coordinate system.
1.11 REFERENCES AND SUGGESTED READING
(1) Computer Graphics, Donald Hearn, M P. Baker, PHI.
(2) Procedural elements of Computer Graphics, David F. Rogers,
Tata McGraw Hill.
(3) Computer Graphics, Rajesh K. Maurya, Wiley - India
1.12 EXERCISE
1. What are the major operations that we perform on Computer
Graphics?
2. Define some of the applications of Computer Graphics.
19
3. Define graphic pipeline and the process involved in it.
4. Differentiate between bitmap and vector based graphics.
5. Define the following terms:
a. Persistence
b. Aspect ratio
c. Frame buffer
d. Resolution
e. Pixel
6. Define horizontal and vertical retrace.
20