Module 1
Module 1
Module 1
COMPUTER GRAPHICS
TEXT BOOK :
DONALD HEARN & M.PAULINE BAKER
Contents
Definition of CG
Computer – Aided Design
Presentation Graphics
Computer Art
Entertainment
Education and Training
Visualization
Image Processing
Graphical User Interfaces
What is Computer Graphics?
Creation, Manipulation and Storage of
geometric objects (modelling) & their images
(rendering).
Display those images on screens or hardcopy
devices.
Applications of Computer
Graphics
Computer Aided Design (CAD)
Presentation Graphics
Computer Art
Entertainment (animation, games, …)
Education & Training
Visualization (scientific & business)
Image Processing
Graphical User Interfaces
1.Computer Aided Design (CAD)
Used in design of buildings, automobiles,
aircraft, watercraft, spacecraft, computers,
textiles & many other products
Objects are displayed in wire frame outline
form
Software packages provide multi-window
environment
Graphics design package provides
standard shapes (useful for repeated
placements)
Animations are also used in CAD
applications
Realistic displays of architectural design
permits simulated “walk” through the
rooms (virtual -reality systems)
2.Presentation Graphics
Used to produce illustrations for reports
or generate slides for use with projectors
Commonly used to summarize financial,
statistical, mathematical, scientific,
economic data for research reports,
managerial reports & customer
information bulletins
Examples : Bar charts, line graphs, pie
charts, surface graphs, time chart
Examples of presentation
graphics
Examples of presentation
graphics
3.Computer Art
Used in fine art & commercial art
Includes artist’s paintbrush programs, paint
packages, CAD packages and animation
packages
These packages provides facilities for designing
object shapes & specifying object motions.
Examples : Cartoon drawing, paintings, product
advertisements, logo design
Computer Art
Electronic painting
Picture painted electronically on
a graphics tablet (digitizer) using a stylus
Cordless, pressure sensitive stylus
Morphing
A graphics method in which one object is
transformed into another
4.Entertainment
Movie Industry
Used in motion pictures, music
videos, and television shows.
Used in making of cartoon
animation films
Computer Graphics is about
animation (films)
Game Industry
Focus on interactivity
Cost effective solutions
Avoiding computations and
other tricks
5.Education & Training
Computer generated models of physical,
financial and economic systems are used
as educational aids.
Models of physical systems, physiological
systems, population trends, or equipment
such as color-coded diagram help trainees
understand the operation of the system
Specialized systems
used for training
applications
simulators for practice
sessions or training of
ship captains
aircraft pilots
heavy equipment
operators
air traffic-control
personnel
Training
6.Visualization
Scientific Visualization
Producing graphical representations
for scientific, engineering, and
medical data sets.
To check the behaviour of certain
process different fields like
engineering, scientists business
analysts etc need appropriate
visualization.
Scientific Visualisation
To view below and
above our visual range
Business Visualization is used in connection
with data sets related to commerce, industry
and other non-scientific areas
Techniques used- color coding, contour plots,
graphs, charts, surface renderings &
visualizations of volume interiors.
Image processing techniques are combined
with computer graphics to produce many of
the data visualizations
7. Image Processing
CG- Computer is used to create a picture
Image Processing – applies techniques to
modify or interpret existing pictures such
as photographs and TV scans
Medical applications
Picture enhancements
Tomography
Simulations of operations
Ultrasonics & nuclear medicine scanners
2 applications of image processing
Improving picture quality
Machine perception of visual information
(Robotics)
To apply image processing methods
Digitize a photograph (or picture) into an image
file
Apply digital methods to rearrange picture parts
to
enhance color separations
Improve quality of shading
Tomography – technique of X-ray photography
that allows cross-sectional views of physiological
systems to be displayed
Computed X-ray tomography (CT) and position
emission tomography ( PET) use projection
methods to reconstruct cross sections from
digital data
Computer-Aided Surgery is a medical application
technique to model and study physical functions
to design artificial limbs and to plan & practice
8.Graphical User Interfaces
Major component – Window manager (multiple-
window areas)
To make a particular window active, click in
that window (using an interactive pointing
device)
Interfaces display – menus & icons
Icons – graphical symbol designed to look like
the processing option it represents
Advantages of icons – less screen space, easily
understood
Menus contain lists of textual descriptions &
icons
VIDEO DISPLAY DEVICES
• Primary output device in a graphics system
• Cathode-Ray Tube (CRT)
– Operation of most video monitors used to
be based
on CRTs
• Other technologies now dominating
– LCDs
– Plasma-panel displays etc.
Refresh Cathode-Ray Tubes
A beam of electrons (cathode rays),
emitted by an electron gun, passes through
focusing and deflection systems that direct
the beam toward specified positions on the
phosphor-coated screen.
The phosphor then emits a small spot of
light at each position contacted by the
electron beam. Because the light emitted
by the phosphor fades very rapidly, some
method is needed for maintaining the
screen picture
Operation of an Electron Gun
Raster-Scan Displays
Raster-Scan Displays
In a raster-scansystem,the
electron beam is swept across
the screen, one row at a time,
from top to bottom. Each row is
referred to as a scan line
Picture definition is stored in a
memory area called the
refreshbuffer or frame
buffer,where the term frame
Raster scan system
Interactive raster-graphics
systems typically employ
several processing units.
In addition to the central
processing unit (CPU), a
special-purpose processor,
called the video controller or
display controller, is used to
control the operation of the
Raster scan system
Raster scan system
A fixed area of the
system memory is
reserved for the frame
buffer, and the video
controller is given
direct access to the
frame-buffer memory.
OpenGL Point-Attribute
Functions
We set the size for an OpenGL point with
glPointSize (size);
OpenGL Point-Attribute
Functions
Line Attributes
Line width is set in OpenGL with the
function
glLineWidth
(width);
INPUT DEVICES
• Keyboards
• Mouse
• Joysticks
• Image scanners
• Touch panels
• Light pens
• Etc…
Graphics Workstations and Viewing
Systems
Graphics workstations range from small general-purpose
computer systems to multi-monitor facilities, often with
ultra-large viewing screens.
For a personal computer, screen resolutions vary from
about 640 by 480 to 1280 by 1024, and diagonal screen
lengths measure from 12 inches to over 21 inches.
For a desktop workstation specifically designed for
graphics applications, the screen resolution can vary from
1280 by 1024 to about 1600 by 1200, with a typical screen
diagonal of 18 inches or more.
High-definition graphics systems, with resolutions up to
2560 by 2048, are commonly used in medical imaging, air-
traffic control, simulation, and CAD.
Contd…
Color Plate 7 shows a 360 paneled viewing system in
the NASA control-tower simulator, which is used for
training and for testing ways to solve air-traffic and
runway problems at airports.
A large, curved-screen system can be useful for
viewing by a group of people studying a particular
graphics application, such as the example in Color
Plate 8.
Graphics Networks
Various resources, such as processors, printers,
plotters, and data files, can be distributed on a
network and shared by multiple users.
A graphics monitor on a network is generally
referred to as a graphics server, or simply a
server. Often, the monitor includes
standard input devices such as a keyboard
and a mouse or trackball. In that case, the
system can provide input, as well as being an
output server.
The computer on the network that is executing
a graphics application program is called the
client, and the output of the program is
displayed on a server.
INTRODUCTION TO
OpenGL
Contd…
Contd…
first step is to initialize GLUT
GlutInitWindowSize (400,
300);
glutInitDisplayMode (GLUT_SINGLE |
GLUT_RGB);
glutDisplayFunc
(lineSegment);
glutMainLoop ( );
glVertex* ( );
glVertex* ( );
Coordinate positions in OpenGL can
be given in two, three, or four
dimensions. We use a suffix value of
2, 3, or 4 on the glVertex function to
indi cate the dimensionality of a
coordinate position.
OpenGL Point Functions
We use the following OpenGL function to
state the coordinate values for a single
position:
glVertex* ( );
Suffix codes for specifying a
numerical data type are i (integer), s
(short), f (float), and d (double).
OpenGL Point Functions
We use the following OpenGL function to
state the coordinate values for a single
position:
glVertex* ( );
Ex:
glVertex2i
OpenGL Point Functions
Calls to glVertex functions must be
placed between glBegin function
and a glEndfunction.
(10,11)
Bresenham’s Line Algorithm
(11,12) ?
(11,12)
(10,11) (11,11)
OR
(11,12)
Bresenham’s Line Algorithm
Bresenham’s Line Algorithm