Comp Graphics
Comp Graphics
Typically CG refers to
•Representation and manipulation of image
data by computer
•Various technologies used to create and
manipulate images
•The subfield of computer science which
studies methods for digitally synthesizing
and manipulate visual content.
APPLICATIONS OF COMPUTER
GRAPHICS
1.COMPUTER AIDED DESIGN (CAD)
2.PRESENTATION GRAPHICS
3.COMPUTER ART
4.ENTERTAINMENT
5.EDUCATION AND TRAINING
6.SCIENTIFIC VISUALIZATION
7.IMAGE PROCESSING
8.GUIS
9.DESKTOP PUBLISHING(DTP)
AUTOCAD
•In design of buildings, automobiles, aircraft,
watercraft, spacecraft, computers, textiles etc.
•Multi window environment
2.PRESENTATION GRAPHICS
•To summarize financial, statistical,
mathematical, scientific and economic data
•Examples
•Bar charts (2D, 3D)
•Line graphs
•Surface charts
•Pie charts
•Power point presentations
3.COMPUTER ART
•Any art in which computers play a role in
production or display of the artwork
•They are used in both fine art and commercial
art
• Fine artiste’s use a variety of technologies
like special purpose h/w , artist’s paint
brush program, other paint packages,
cad packages to produce image.
• In commercial art they are used for logos and
other design, advertising etc
4.ENTERTAINMENT
Computer graphics methods are now
•
6.SCIENTIFIC VISUALIZATION
•To analyze large amounts of data or to study the
behavior of certain processes
•Produce graphical representation
•Scientific, engineering and medical data sets
•Data sets
• scalar, vector also 2d and 3d
•For better visualization
•Color coding, graphs, charts, also
image processing with graphics
•Some applications
* Numerical visualization of ocean currents
* Thunderstorm simulation
* molecular visualization
7.IMAGE PROCESSING
•Computer manipulation of images.
•In CG a computer is used to create a picture,
on the other hand it applies techniques to
modify or interpret existing pictures such as
photographs & tv scans.
•Photo enhancement - sharpening blurred photos
internal examination
•Commercial art- enhancing images
8.GUIs
•GUI, A graphic, mouse-oriented paradigm which
RANDOM-SCAN DISPLAYS
•Here The CRT's electron beam is 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
and for this reason are also referred to as vector displays
(or stroke-writing or calligraphic displays or line drawing
displays)
\
•The accelerating voltage can be generated with an
accelerating anode
•Sometimes the electron gun is built to contain the
accelerating anode and focusing system within the same
unit.
Phosphor screen
•Different kinds of phosphors are available for use in a CRT.
•Besides color, a major difference between phosphors is
their persistence:
•How long they continue to emit after the CRT beam is
removed.
•Persistence is defined as the time it takes the emitted
light from the screen 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 animation;
•A high-persistence phosphor is useful for displaying
highly complex, static pictures
•Another important properties of phosphor
includes Resolution and Aspect Ratio
•The maximum number of points that can be displayed
without overlap on a CRT is referred to as the resolution.
•Number of pixels per square inch
•The ratio of vertical points to horizontal points necessary to
produce equal-length lines in both directions on the
screen is known as Aspect Ratio.
•An aspect ratio of ¾ means that a vertical line plotted with 3
points has the same length as a horizontal line plotted
with 4 points
Inline arrangement
3 electron guns and the corresponding red-green-blue color
dots on the screen, are aligned along one scan line rather of in a
triangular pattern.
This inline arrangement of electron guns is easier to keep in
alignment and is commonly used in high-resolution color
CRT’s
In some low-cost systems, the electron beam can only be set
to on or off, limiting displays to eight colors.
More sophisticated systems can set intermediate intensity
levels for the electron beams, allowing several million different
colors to be generated
Color CRTs in graphics systems are designed as RGB
monitors.
These monitors use shadow mask method and take the
intensity level for each gun.
A RGB color system with 24 bits of storage per pixel is
known as full color system or true color system.
Advantages
Disadvantages
low resolution
expensive
COMPARISON BETWEEN SHADOW MASK AND BEAM
PENETRATION METHOD
Flat panel displays
Flat panel displays are class of a class of video devices
that have reduced volume,weight,and power requirements
compared to a CRT. This post explains about flat panel
displays and explains types of displays like plasma
panel, working of LCD,LED etc. Malayalam tutorial is also
included
MODULE 2
DIGITAL DIFFERNTIAL ANALYZER
ALGORITHM(DDA)
Output Primitives
•Basic geometric structures from which an image can be formed
•Point
•Line
•Circle
•Conic Sections
•Primitive operations
•putpixel ( x, y, color)
•getpixel (x, y )
Scan conversion
•Process of converting basic low level objects into their
corresponding pixel map representations
•Scan Conversion of line- DDA line Drawing Algorithm
DIGITAL DIFFERENTIAL
ANALYZER(DDA)
•It is a line drawing algorithm which uses cartesian slope intercept
equation of straight line
•Line drawing is accomplished by calculating intermediate point
coordinates along the line path between two given end points.
•Disadvantage is the use of round off operations and round off
errors
•New point is
Case 2:m>1
Case 3:m=1
•New point is
(x , y )=(x +1, y +1)
k+1 k+1 k k
Algorithm
Bresenham's Circle Generating Algorithm
Example
Draw a circle with center (0,0 and radius=3
Xc=0,Yc=0, r=3,Assign X=0, y=r⇒y=3
Initial value of p=3-2r →3-2*3 =-3_p=-3)
POLYGON FI LLI NG
•Given vertices of a polygon and a colour , our aim is to
fill the polygon with the particular colour
•2 methods
–Boundary method
•Intersect polygon with horizontal lines and
fills the polygon between pairs of intersection
•Used with simple objects
– Fill method
•Start from an interior position and paint until
the boundary condition reached
•Complex objects, Interactive paintings
SCANLI NE POL YGO N FILLING
AL GO RITH M
•Filling up of polygons using horizontal lines or scanlines
•Purpose is to fill the interior pixels of a polygon , given only
vertices and edges of the figure
•Algorithm works by intersecting scanline with the polygon edges
and fill the polygon between pairs of intersection
BASIC CONCEPTS
Simple example
SPECIAL CASES
•Some scan line intersections at polygon vertices requires
special handling
•A scan line passing through vertex intersects two
polygon edges at that position adding two points to the
list of intersections for the scanline
•2 cases
–If both lines intersecting at the vertex are on the same side of the
–If lines intersecting at the vertex are on the opposite side of the
MODULE 3
Basic GeometricTransformations
Basic geometric transformations include Translation,
Rotation and Scaling. Transformation means to change
the size, shape or orientation of an object.
• Transform=change some attributes/primitives of
graphic objects• changes can be in size, shape,
orientation...
•Basic Transformations
•P’ = P * S
x ‘ = x cos q - y sin q
y ‘ = x sin q + y cos q
MATRIX REPRESENTATION
TRANSLATION
SCALING
ROTATION
BASICS
• Basic geometric transformations can be represented in general
matrix form
P’=M1*P+M2
•P’ and P are coordinate positions represented as column
vectors
•M1 is a 2x2 matrix containing multiplicative terms
•M2 is a 2 element column vector containing
translational terms
•For translation M1 is the identity matrix
TRANSLATION
SCALING
P’ = P * T(Sx,Sy)
Matrix
no change in X values
Change in Y values only
Matrix
no change in Y values
Change in X values only
Matrix
X’ = -X
Y’ = -Y
Matrix
X’ = Y
Y’ = X
Position of reflected point can be calculated
from the equation
2D Transformation SHEAR
*A Transformation that distorts the shape of an object
Window
´ area where image is viewed in real world (in real world coordinates)
´world coordinate area
´ defines what is to be displayed
View Port
´ area where image is viewed in o/p device (in device coordinates)
´ display device coordinate area
´ defines where it is to be displayed
What Is Clipping?
* w.r.t. window
Clipping
is an inside-outside procedure
It includes
Define the window area
Discarding portions outside window
before clipping
after clipping
Classifications
*Point Clipping
* Line Clipping
* Polygon Clipping
Point Clipping
*line L1
ENDPOINTS
0000
0000
-----------AND
0000
Completely inside
*line L2
ENDPOINTS
0100
0100
-----------AND
0100
Completely inside
LINES AFTER CLIPPING
SUTHERLAND AND
HODGEMAN POLYGON CLIPPING
EXAMPLE
DISADVANTAGE
•This algorithm will not clip the concave
polygon properly
•A line is created through the window boundary
MODULE 5
RGB COLOR MODEL
◦Red+Green+Blue = White
******************************************************************
Graphics Software
A graphics software is an intermediary between an
application program & the graphics hardware.
The output primitives & interaction devices that a
graphics package supports can range from rudimentary
to extremely rich.
There are two general classifications for graphics
software:
General Programming packages: provides an
extensive set of graphics functions that can be used in a
high-level programming language, such as C or
FORTRAN.
Basic functions in a general package include those for
generating picture components (straight line, circle,
polygon etc),setting color and intensity values, &
applying transformations.
Special-purpose applications packages: Designed for
nonprogrammers, so that users can generate displays
without worrying about how graphics operations work.
Example of such application packages are the artist’s
painting programs and various business,medical and
CAD systems.
Graphics Functions
These packages provides users with a variety of
functions for creating & manipulating pictures.
Output primitives: basic building blocks.
Attributes: properties of the output primitives.
Geometric transformations: changing size, position
& orientation.
Modeling transformations: construct scene using
object descriptions.
Viewing transformations: are used to specify the
view that is to be presented.
Input Functions: used to control & process the data
flow from the interactive devices such as mouse, tablet
or joystick.
Control operations: contains no. of housekeeping
tasks such as clearing a display screen & initializing
parameters.
Software Standards
A standard graphics package such as GKS(Graphical
kernal system) & PHIGS (Programmers Hierarchical
Interactive graphics system) implements a specification
designated as standard by an official national or
international standard bodies by ISO and
ANSI(American National Standard Institute).
The main purpose of such standards is to promote
portability of application programs & of programmers.
Non-official standards are also developed, promoted &
licensed by individual companies or by consortia of
companies eg Adobe’s Post script & MIT’s X window
system are two industry standards.
****************************************************************