0% found this document useful (0 votes)
61 views179 pages

Computer Graphics Techniques Overview

The document outlines various topics in computer graphics, including visibility problems, 2D and 3D transformations, and different display technologies such as CRT, LCD, and LED. It also covers algorithms for line and circle drawing, including Bresenham and Midpoint algorithms, along with their applications. Additionally, it discusses color models and the components of different display systems.

Uploaded by

suganthi s
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
61 views179 pages

Computer Graphics Techniques Overview

The document outlines various topics in computer graphics, including visibility problems, 2D and 3D transformations, and different display technologies such as CRT, LCD, and LED. It also covers algorithms for line and circle drawing, including Bresenham and Midpoint algorithms, along with their applications. Additionally, it discusses color models and the components of different display systems.

Uploaded by

suganthi s
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

COMPUTER GRAPHICS

YEAR TOPIC SECTION


July • Visibility Problem in 3D graphics (Painters algorithm & Backface III
2018 culling)
• Refresh rate of Frame buffer I
•2D geometric transformation in homogeneous coordinates II
Dec • 3D Graphics(back-face culling, Z-buffer) III
2018 •Frame buffer ( Size of the color lookup table - LUT) I
• 3D Graphics (Perspective and parallel projection) III
•2D matrix transforms II
•Midpoint (Bresenham) algorithm I
June • Phong reflectance Model III
2019 •Raster System I
• Orthographic Transformation III
•2D Transformation II
Dec • Aspect Ratio I
2019 • Raster system I
•Line Clipping II
•Window operations II
YEAR TOPIC UNIT

Nov • 3D Projection (Perspective & Orthographic) III


2020 • 2D Transformation II
• Bezier Curve III
• Phong shading & Gourang Shading III
• 3D Graphics – perspective projection III
Jun • Transformation Matrix II
2021 • 3D Graphics – viewport III
•Calculate Hard Disk space I
•Bezier curve III
•Midpoint (Bresenham) algorithm & DDA algorithm I
YEAR TOPIC SECTION

June • Homography –Transformations II


& dec •Hidden Surface removal III
2022 •Raster Scan Device I

Jun • Transformation II
2023 •Bezier & B-Splines III
•Rectangle Line clipping II
• Clipping II
Dec • Basic - color models I
2023 • Transformation - Line II
• Algorithms I & II
• Transformation – triangle II
 Computer graphics is the use of a computer to define,
store, manipulate, and represent the pictorial output.

Cognitive
1. Cathode-Ray Tube (CRT)

2. Color CRT Monitor

3. Liquid Crystal Display (LCD)

4. Light Emitting Diode (LED)

5. Direct View Storage Tube (DVST) / Memory Tube Display

6. Plasma Display

7. 3D Display
Components:

Electron Gun: The electron gun


is made up of several elements,
mainly a heating filament
(heater) and a cathode.

Focusing & Accelerating


Anodes: These anodes are used
to produce a narrow and sharply
focused beam of electrons.

Phosphorus-coated Screen:
Horizontal & Vertical Deflection The phosphorus coated screen is
Plates: These plates are used to guide the used to produce bright spots
path of the electron the beam. The plates when the high-velocity electron
produce an electromagnetic field that beam hits it.
bends the electron beam through the area
as it travels. [Link]
Random Scan (Vector scan) Raster Scan
Aka: Stroke-writing display or calligraphic •It is a scanning technique in which

display the electron beam moves along the

• High resolution screen. It moves from top to bottom,

• In this, the electron beam points only to covering one line at a time.

the area in which the picture is to be drawn. • Low resolution


Ex: Television
The beam refreshing has two types:
1. Horizontal Retracing
2. Vertical Retracing
 The basic idea behind the color CRT monitor is to combine three basic
colors- Red, Green, and Blue. By using these three colors, we can produce
millions of different colors.
CRT Vs LCD

[Link]
Two basic color display producing techniques:
Beam Penetration Method: Shadow-Mask Method:
• It is used with a random scan monitor
• It is used with a raster scan monitor for
for displaying pictures.
displaying pictures.
• There are two phosphorus layers- Red
•It has more range of color than the beam
and Green are coated inside the
penetration method.
screen. The color shown depends on
•It is used in television sets and monitors.
how far the electron beam penetrates
the phosphorus surface

Intermediate Electron– Orange & Yellow


LED LCD
Light Emitting Diodes Liquid Crystal Device
Aka: Emissive Display Aka: Non-Emissive Display

The emissive displays are devices that Displays use optical effects to convert
convert electrical energy into light. sunlight or light from some other source into
graphics patterns.

All LEDs are a subset of LCD TV All LCDs are not a subset of LED TV

Light emitting diodes are usually placed Fluorescent lights are usually placed behind
behind the screen or around the edges the screen

LEDs are Thinner LCDs are thicker


More Energy Efficient Lack Energy efficiency compared to LED
 It is used to store the picture information as a charge
distribution behind the phosphor-coated screen.
 There are two guns used in DVST:
[Link] Gun: It is used to store the picture information.
[Link] / Secondary Gun: It is used to display a picture on the
screen.
 It is a type of flat panel display which uses tiny plasma cells. It is also
known as the Gas-Discharge display.

Components of plasma display:

[Link]: It is used to deliver a positive voltage.


It also has the line wires.
[Link]: It is used to provide negative voltage
to gas cells. It also has fine wires.
[Link] Plates: These plates work as capacitors.
When we pass the voltage, the cell lights regularly.
[Link] cells: It contains small pockets of
gas liquids when the voltage is passed to
this neon gas. It emits light.
 It is also called stereoscope display technology. This technology is
capable of bringing depth perception to the viewer. It is used for 3D
gaming and 3D TVs. For Example: Fog Display, Holographic Display,
Retina Display Etc.
a. Glass i. Contains liquid crystal and serves as a bonding surface for
conductive coating
b. Conductive coating ii. Acts as a conductor so that a voltage can be applied across
the liquid crystal
c. Liquid Crystal iii. A substance which will polarize light when a voltage is
applied to it
d. Polarized Film iv. A transparent sheet that polarizes light

A. a-i, b-ii, c-iii, d-iv

B. a-i, b-iii, c-ii, d-iv

C. a-iv, b-iii, c-ii, d-I

D. a-iv,b-ii, c-i, d- iii


a. Glass i. Contains liquid crystal and serves as a bonding surface for
conductive coating
b. Conductive coating ii. Acts as a conductor so that a voltage can be applied across
the liquid crystal
c. Liquid Crystal iii. A substance which will polarize light when a voltage is
applied to it
d. Polarized Film iv. A transparent sheet that polarizes light

A. a-i, b-ii, c-iii, d-iv


B. a-i, b-iii, c-ii, d-iv

C. a-iv, b-iii, c-ii, d-I

D. a-iv,b-ii, c-i, d- iii


A. (a) only
B. (a) and (b) only
C. (a), (b) and (c)
D. (a), (b), (c) and (d)
Match the following:
List- I List- II
a. Tablet, Joystick i Continuous devices
b. Light Pen, Touch Screen ii. Direct devices
c. Locator, Keyboard iii. Logical devices
d. Data Gloves, Sonic Pen iv. 3D interaction wires
code
a b c d
[Link] i iv iii
B.i iv iii ii
C.i ii iii iv
[Link] iii ii i
Match the following:
List- I List- II
a. Tablet, Joystick i. Continuous devices
b. Light Pen, Touch Screen ii. Direct devices
c. Locator, Keyboard iii. Logical devices
d. Data Gloves, Sonic Pen iv. 3D interaction wires
code
a b c d
[Link] i iv iii
B.i iv iii ii
C.i ii iii iv
[Link] iii ii i
LINE DRAWING ALGORITHM

DDA BRESENHAM MIDPOINT

Digital Differential
Analyzer
A ( 0, 0 ) B( 8, 4 )
x1, y1 x2 , y2
dx = x2-x1 = 8 – 0 =8
dy = y2-y1 = 4 – 0 = 4
if |8| > |4| then T
steps= |8|= 8
xincr = 8 / 8 = 1
yincr = 4 / 8 = 1 / 2 = 0.5

xold yold xnew Ynew round(x) round(y)

0 0 1 0.5 1 1
1 0.5 2 1 2 1
2 1 3 1.5 3 2
3 1.5 4 2 4 2
4 2 5 2.5 5 3
5 2.5 6 3 6 3
6 3 7 3.5 7 4
Trace the Bresenham algorithm for drawing a line segment from (20,10) to (30,18)
A (20, 10) B (30, 18)
x1,y1 x2,y2

X= 20 ; y=10

dx = 30-20=10 m <= 1

dy = 18-10 = 8

m= dy / dx = 8 / 10 = 4 / 5 = 0. 8

Decision point:

P = 2dy – dx = 16 – 10 = 6
Pk >= 0 ; x + 1, y+1 2dx = 2 * 10 = 20 2dy-2dx=16 -20 =-4
Pk < 0 ; x + 1 2dy = 2 * 8 = 16

k Pk xk+1 yk+1 Pk < 0 Pk >= 0


p = p + 2dy p = p + 2dy – 2dx
(20) (10)

0 6 21 11 --- 6+16-20=6-4=2
1 2 22 12 ---- 2+16-20=2-4=-2
2 -2 23 12 -2+16=14 ---
3 14 24 13 ---- 14-4=10
4 10 25 14 ---- 10-4=6
5 6 26 15 ---- 6-4=2
6 2 27 16 ---- 2-4=-2
7 -2 28 16 -2+16=14 ----
8 14 29 17 ---- 14-4=10
9 10 30 18
k Pk xk+1 yk+1 Pk < 0 Pk >= 0
p = p + 2dy p = p + 2dy – 2dx
(20) (10)

0 6 21 11 --- 6+16-20=6-4=2

1 2 22 12 ---- 2+16-20=2-4=-2

2 -2 23 12 -2+16=14 ---

3 14 24 13 ---- 14-4=10
4 10 25 14 ---- 10-4=6
5 6 26 15 ---- 6-4=2
6 2 27 16 ---- 2-4=-2
7 -2 28 16 -2+16=14 ----

8 14 29 17 ---- 14-4=10
9 10 30 18

Ans: (21,11),(22,12),(23,12),(24,13),(25,14),(26,15),(27,16),(28,16),(29,17)
Trace the Midpoint algorithm for drawing a line segment from (4,8) to (9,12)
A (4, 8) B (9, 12)
x1,y1 x2,y2

X= 4 ; y=8

dx = 9 – 4 = 5 m <= 1

dy = 12 - 8 = 4

m= dy / dx = 4 / 5 = 0. 8

Decision point:

P = dy – (dx / 2 ) = 4 – (5 /2) = 4 – 2.5 = 1.5


Pk >= 0 ; x + 1, y+1 dx=5 ; dy= 4 ;
Pk < 0 ; x + 1 dy-dx=4 – 5 = -1

k Pk xk+1 yk+1 Pk < 0 Pk >= 0


p = p + dy p = p + dy – dx
(4) (8)

0 1.5 5 9 ---- 1.5-1 = 0.5


1 0.5 6 10 --- 0.5-1=-0.5
2 -0.5 7 10 -0.5+4=3.5 ----

3 3.5 8 11 --- 3.5-1=2.5


4 2.5 9 12

Output:

(4,8), (5,9),(6,10),(7,10),(8,11),(9,12)
CIRCLE DRAWING ALGORITHM

BRESENHAM MIDPOINT
COMPUTER GRAPHICS
Trace the Bresenham algorithm for drawing a line segment from (4,6) to (15,12)
A (4, 6) B (15, 12)
x1,y1 x2,y2

X= 4 ; y=6

dx = 15-4=11

dy = 12-6 = 6

m= dy / dx = 6 / 11 = 4 / 5 = 0. 5 m <= 1
Decision point:

P = 2dy – dx = 12– 11 = 1
Pk >= 0 ; x + 1, y+1 2dx = 2 * 11 = 22 2dy-2dx=12 -22 =-10
Pk < 0 ; x + 1 2dy = 2 * 6 = 12

k Pk xk+1 yk+1 Pk < 0 Pk >= 0


p = p + 2dy p = p + 2dy – 2dx
(4) (6)

0 1 5 7 --- 1-10=-9
1 -9 6 7 -9+12=3 ---
2 3 7 8 --- 3-10=-7
3 -7 8 8 -7+12=5 ---
4 5 9 9 ---- 5-10=-5
5 -5 10 9 -5+12=7 ---
6 7 11 10 7-10=-3
7 -3 12 10 -3+12=9 ---
8 9 13 11 ---- 9-10=-1
9 -1 14 11 -1+12=11
CIRCLE DRAWING ALGORITHM

BRESENHAM MIDPOINT
 Plot a circle having radius 10 units using bresenham algorithm:
r = 10 pk < 0 ;xk+1 = xk + 1
origin (0,0)
1st octant = 0,r = (0,10) pk >= 0 ;xk+1 = xk + 1,yk+1 = yk -1
p = 3 – 2 r = 3 -2(10)=3-20= -17

Pk < 0 Pk >= 0
K xk yk pk Xk+1 Yk+1 p = pk + 4xk + 6 p = pk + 4(xk - yk) + 10

0 0 10 -17 1 10 -17+4(0)+6=-11 -----

1 1 10 -11 2 10 -11+4(1)+6=-1 -----

2 2 10 -1 3 10 -1+4(2)+6=13 ---

3 3 10 13 4 9 ----- 13+4(3-10)+10=
13-28+10=-5
4 4 9 -5 5 9 -5+4(4)+6= - -----
5+16+6=17
5 5 9 17 6 8 ----- 17+4(5-9)+10=
17-16+10 =11
6 6 8 11 7 7 Stop when x>= y
Answer :
1st octant : (0,10),(1,10),(2,10),(3,10),(4,9),(5,9),(6,8),(7,7)
Plot a circle having radius 10 units using Midpoint algorithm:
r = 10
origin (0,0) pk < 0 ;xk+1 = xk + 1
1st octant = 0,r = (0,10) pk >= 0 ;xk+1 = xk + 1,yk+1 = yk - 1
p = 1 - r = 1 - 10= -9
Pk < 0 Pk >= 0
K xk yk Pk Xk+1 Yk+1 p = pk + 2xk + 3 p = pk + 2(xk - yk) + 5
(-9)
0 0 10 -9 1 10 -9 +2(0)+3=-6 -----
1 1 10 -6 2 10 -6+2(1)+3=-1 -----

2 2 10 -1 3 10 -1+2(2)+3=6 ---
3 3 10 6 4 9 ----- 6+2(3-10)+5=
6-14+5=-3
4 4 9 -3 5 9 -3+2(4)+3= - -----
3+8+3=8
5 5 9 8 6 8 ----- 8+2(5-9)+5=
8-8+5 =5
6 6 8 5 7 7 Stop when x>= y
Answer :
1st octant : (0,10),(1,10),(2,10),(3,10),(4,9),(5,9),(6,8),(7,7)
1st octant : (0,10),(1,10),(2,10),(3,10),(4,9),(5,9),(6,8),(7,7)
(x,y)
2nd octant : (10,0),(10,1),(10,2),(10,3),(9,4),(9,5),(8,6),(7,7)
(y,x)
3rd octant : (10,0),(10,-1),(10,-2),(10,-3),(9,-4),(9,-5),(8,-6),(7,-7)
(y,-x)
4th octant : (0,-10),(1,-10),(2,-10),(3,-10),(4,-9),(5,-9),(6,-8),(7,-7)
(x,-y)
5th octant : (0,-10),(-1,-10),(-2,-10),(-3,-10),(-4,-9),(-5,-9),(-6,-8),(-7,-7)
(-x,-y)
6th octant : (-10,0),(-10,-1),(-10,-2),(-10,-3),(-9,-4),(-9,-5),(-8,-6),(-7,-7)
(-y,-x)
7th octant : (-10,0),(-10,1),(-10,2),(-10,3),(-9,4),(-9,5),(-8,6),(-7,7)
(-y, x)
8th octant : (0,10),(-1,10),(-2,10),(-3,10),(-4,9),(-5,9),(-6,8),(-7,7)
(-x,y)
DDA BRESENHAM MIDPOINT
Advantage: Advantage: Advantage:
• Use Floating point (Real • Use Fixed point (Integer arithmetic) • Aka: Generalized Bresenham
arithmetic) so Simple to implement •This algorithm is efficient for
•Uses Multiplication and •Uses only subtraction & Addition scan conversion for drawing
Division Operation (Costly) operations geometric curves on raster
•Faster algorithm than the •Fast incremental algorithm than the display
direct line equation (y=mx+c) DDA •High accuracy & speed
•Do not use floating point operation
so no round-off
• Pointing accuracy is higher than
DDA algorithm
•High accuracy & Speed than
midpoint
Disadvantage: Disadvantage: Disadvantage:
• Floating point arithmetic •Anti-aliasing is not the part of the • Time consumption is high
operation and round-off the Bresenham’s circle drawing algorithm •Resulted line/circle is not smooth
value is time consuming (Straight lines cannot be
• Point position is not displayed straight because
accurate & Efficient distance between the pixel is not
equal)
Polygon – A closed planer path composed of a finite number of sequential line segments
Types of Ploygon Filling Algorithm: Types of Polygon
1. Seed Fill Algorithm Boundary Fill Algorithm
Flood Fill Algorithm
2. Scan Fill Algorithm
Boundary Fill Algorithm -This algorithm picks a point inside
an object and starts to fill until it hits the boundary of the object.
• 4-Connected Polygon • 8-Connected Polygon
➢ Neighboring pixels are pixels on left, ➢ Neighboring pixels are left, right ,above,
right, above and below of current pixel. below and 4 diagonal pixels

Restrictions:
✓Starting point should be inside closed polygon.
✓For all edges of a polygon, boundary color should be same.
✓It may fail to fill in case some interior pixels are already filled with color.
Flood Fill Algorithm - Fill the area with multiple boundary colors.

• 4-Connected Polygon • 8-Connected Polygon


➢ Neighboring pixels are pixels on left, ➢ Neighboring pixels are left, right ,above,
right, above and below of current pixel. below and 4 diagonal pixels
Scan Fill Algorithm – Determine the overlap intervals for scan lines that cross the area
or scan line. A scan line is a line of pixels that are plotted on display device when electron
beam scans the display area horizontally.
SOLUTION:
Transformation is a process of modifying and re-positioning the existing graphics

Fundamental Geometrical
Transformation

Derived Geometrical
Transformation
Xnew = Xold + Tx
Translation is a process of moving
an object from one position to Ynew = Yold + Ty
another in a two dimensional plane.
Given a square with coordinate points A(0, 3), B(3, 3), C(3, 0), D(0, 0). Apply the translation with
distance 1 towards X axis and 1 towards Y axis. Obtain the new coordinates of the square.
Given-
Old coordinates of the square = A (0, 3), B(3, 3), C(3, 0), D(0, 0)
Translation vector = (Tx, Ty) = (1, 1)

Co- Calculation New


ordinate Coordinate
A(0,3) Xnew = Xold + Tx = 0 + 1 = 1 A (1,4)
Ynew = Yold + Ty = 3 + 1 = 4
B(3,3) Xnew = Xold + Tx = 3 + 1 = 4 B(4,4)
Ynew = Yold + Ty = 3 + 1 = 4
C(3,0) Xnew = Xold + Tx = 3 + 1 = 4 C(4,1)
Ynew = Yold + Ty = 0 + 1 = 1
D(0,0) Xnew = Xold + Tx = 0 + 1 = 1 D(1,1)
Ynew = Yold + Ty = 0 + 1 = 1
Xnew = Xold x Sx
Scaling in computer graphics is
like changing the size of an object Ynew = Yold x Sy
on your computer screen
Given a square object with coordinate points A(0, 3), B(3, 3), C(3, 0), D(0, 0). Apply the scaling
parameter 2 towards X axis and 3 towards Y axis and obtain the new coordinates of the object.
Old coordinates of the square = A (0, 3), B(3, 3), C(3, 0), D(0, 0)
Scaling factor along X axis = 2
Scaling factor along Y axis = 3

Co- Calculation New


ordinate Coordinate
A(0,3) Xnew = Xold x Sx = 0 x 2 = 0 A (0,9)
Ynew = Yold x Sy = 3 x 3 = 9
B(3,3) Xnew = Xold x Sx = 3 x 2 = 6 B(6,9)
Ynew = Yold x Sy = 3 x 3 = 9
C(3,0) Xnew = Xold x Sx = 3 x 2 = 6 C(6,0)
Ynew = Yold x Sy = 0 x 3 = 0
D(0,0) Xnew = Xold x Sx = 0 x 2 = 0 D(0,0)
Ynew = Yold x Sy = 0 x 3 = 0
process of rotating an object with
Xnew = Xold * cosθ –Yold * sinθ
respect to an angle in a two Ynew = Xold * sinθ + Yold * cosθ
dimensional plane
G
Given a triangle with corner coordinates (0, 0), (1, 0) and (1, 1). Rotate the triangle by 90 degree
anticlockwise direction and find out the new coordinates.
Old corner coordinates of the triangle = A (0, 0), B(1, 0), C(1, 1)
Rotation angle = θ = 90º

Co- Calculation New


ordinate Coordinate
A(0,0) Xnew= Xold x cosθ –Yold x sinθ A (0,0)
= 0 x cos90º – 0 x sin90º= 0
Ynew= Xold x sinθ + Yold x cosθ
= 0 x sin90º + 0 x cos90º= 0
B(1,0) Xnew= Xold x cosθ –Yold x sinθ B(0,1)
= 1 x cos90º – 0 x sin90º= 0
Ynew= Xold x sinθ + Yold x cosθ
= 1 x sin90º + 0 x cos90º= 1 + 0= 1
C(1,1) Xnew= Xold x cosθ –Yold x sinθ C(-1,1)
= 1 x cos90º – 1 x sin90º= 0 – 1= -1
Ynew= Xold x sinθ + Yold x cosθ
= 1 x sin90º + 1 x cos90º= 1 + 0= 1
• Reflection is a kind of rotation where the
angle of rotation is 180 degree.
• The reflected object is always formed on
the other side of mirror.
• The size of reflected object is same as the
size of original object.

Reflection On X-Axis:
Xnew = Xold
Ynew = -Yold
Reflection On Y-Axis:
Xnew = -Xold
Ynew = Yold
Given a triangle with coordinate points A(3, 4), B(6, 4), C(5, 6). Apply the reflection on the X axis and
obtain the new coordinates of the object.
Old corner coordinates of the triangle = A (3, 4), B(6, 4), C(5, 6)
Reflection has to be taken on the X axis

Co- Calculation New


ordinate Coordinate
A(3,4) Xnew = Xold = 3 A (3,-4)
Ynew = -Yold = -4
B(6,4) Xnew = Xold = 6 B(6,-4)
Ynew = -Yold = -4
C(5,6) Xnew = Xold = 5 C(5,-6)
Ynew = -Yold = -6
shearing involves skewing an object along one of the axes (x-axis or y-axis)
Given a triangle with points (1, 1), (0, 0) and (1, 0). Apply shear parameter 2 on X axis and 2 on Y axis
and find out the new coordinates of the object.
Old corner coordinates of the triangle = A (1, 1), B(0, 0), C(1, 0)
Shearing parameter towards X direction (Shx) = 2
Shearing parameter towards Y direction (Shy) = 2

Co- X-shear X-shear Y-shear Y-shear


ordinate New New
Coordinate Coordinate
A(1,1) Xnew = Xold + Shx x Yold A (3,1) Xnew = Xold = 1 A(1,3)
=1+2x1=3 Ynew = Yold + Shy xXold
Ynew = Yold = 1 =1+2x1=3
B(0,0) Xnew = Xold + Shx x Yold B(0,0) Xnew = Xold = 0 B(0,0)
=0+2x0=0 Ynew = Yold + Shy x Xold
Ynew = Yold = 0 =0+2x0=0
C(1,0) Xnew = Xold + Shx x Yold C(1,0) Xnew = Xold = 1 C(1,2)
=1+2x0=1 Ynew = Yold + Shy x Xold
Ynew = Yold = 0 =0+2x1=2
✓ Homogeneous coordinates are a mathematical representation used in
projective geometry and computer graphics to describe points, lines,
and planes.
✓ Homogeneous coordinates are an extension of Cartesian coordinates,
adding an extra coordinate, typically denoted as 'w'. In 2D (uses affine
transformation) homogeneous coordinates, a point is represented as
(x, y, w), and in 3D (linear transformation), as (x, y, z, w).
✓ Homogeneous coordinates enable the representation of points at
infinity, which is particularly useful in projective geometry and
computer graphics.
✓ Homogeneous coordinates simplify geometric transformations such as
translation, rotation, scaling, and perspective projection by allowing
them to be represented as matrix multiplications.
✓ While more complex than Cartesian coordinates, homogeneous
coordinates offer a more elegant and versatile framework for handling
transformations and perspective effects, especially in computer
graphics applications.
Transformation
Composition of Reflection One Rotation
General Pivot point Rotation • Translate object to origin from its original position
or • Rotate the object about the origin
Rotation about Fixed point • Translate the object to its original position from origin. It is
called as reverse translation
General Fixed point Scaling • Translation
• Scaling
• Translation
General Scaling direction • Rotate the two scaling translation
• Scale
• Rotate the two scaling translation
Two Successive Translation & Additive
Rotation
Two Successive Scaling Multiplicative
 Homography, also referred to as planar homography, is a transformation that is
occurring between two planes. In other words, it is a mapping between two
planar projections of an image. It is represented by a 3x3 transformation matrix in
a homogenous coordinates space. Mathematically, the homography matrix is
represented as:
x, y, w

W is equal to zero means


infinity
Sx (Horizontal)= 0.5 = ½ < 1 -> Decrement

Sy (vertical)= 1.5 =3/2 (3*1/2) >1 -> Increment


• Clipping is a process of dividing the object into visible and invisible portions and displaying
the visible portion and discarding the invisible portion
Clipping Types

Point Line Polygon Text


Line Clipping

Cohen Midpoint Liang-Barsky Vs Nicholl-Lee-Nicholl


Sutherland Subdivision Cyrus-Beck (Best) algorithm
• Divides the 2D- • Line is divided into • More efficient than • Fast line clipping
space into 9 regions two parts cohen-sutherland and algorithm
and efficiently •Midpoint of line is can be extended into •Reduces the
determines the lines obtained by dividing it 3D clipping chances of clipping a
& portion of lines in two segments. single line segment
that are visible in Again division is done between multiple
the central region of by finding midpoint time as may happen
interest (Viewport) •This process is in the cohen-
•Reject & accept line continued until line of sutherland
quickly visible and invisible algorithm
•Calculate end-point category is obtained
quickly
Let R be the rectangular window against which the lines are to be clipped using 2D
Sutherland-Cohen line clipping algorithm. The rectangular window has lower
rectangular corner at (-5, 1) and upper right-hand corner at (3, 7). Consider the following
three lines for clipping with the given end-point coordinates?
Line AB:A(-6,2) and B(-1,8)
Line CD: C(-1,5) and D(4,8)
Line EF: E(-2,3) and F(1,2)
Which of the following lines is/are candidate for clipping?
A. AB
B. DC
C. EF
D. AB and CD
TBRL
TBRL
TBRL
Let R be the rectangular window against which the lines are to be clipped using 2D
Sutherland-Cohen line clipping algorithm. The rectangular window has lower
rectangular corner at (-5, 1) and upper right-hand corner at (3, 7). Consider the following
three lines for clipping with the given end-point coordinates?
Line AB:A(-6,2) and B(-1,8)
Line CD: C(-1,5) and D(4,8)
Line EF: E(-2,3) and F(1,2)
Which of the following lines is/are candidate for clipping?
A. AB
B. DC
C. EF
D. AB and CD
P S

Q
Southerland Hodgeman(Convex polygon clipping)

Weiler –Atherton (concave polygon clipping)


POLYGON CLIPPING
ANS : Convex Polygon
(3,2)
(0,2)
Scaling -> Sx= 2 ; Sy=3

X Y X*Sx Y*Sy (0,0) (3,0)


o o 0*2=0 0*3=0
0 2 0*2=0 2*3=6
3 0 3*2=6 0*3=0
3 2 3*2=6 2*3=6
(4,5)
(2,3)
(5,3)
(0,1)
(0,0)

(-1,0)
• To identify those parts of a scene that are visible from a chosen viewing position

Object Space Model Image Space Model


Determine visibility through object Determine visibility through Pixel
Determine which objects are in Determine which object is visible at each pixel
front of others
Uses Physical Co-ordinate system Uses Screen Co-ordinate system
Ex: Ex:
• Back Face Detection Method • Depth Buffer (Z-Buffer)
• Painter’s Algorithm • Scan Line Method(BruteForce rasterization)
• Area Subdivision (Warnock Algorithm)
➢ It is an Object-space algorithm
➢Back face culling is a technique used to eliminate invisible back facing polygons (which
are not facing viewer) from further processing.
➢ Principle behind back face culling is that if a polygon on a 3D model is facing away from
you, then it cannot be seen.
➢ It is Image space Model
➢ Z buffer is a visible surface detection method. This is also known as depth buffer method.
➢Depth values are stored for each position (x, y) during the surface processing. Each surface
is processes separately in any order
➢Z- buffer is a 16 – bit, 32 – bit or 64 – bit field associated with each pixel in a frame buffer
that can be used to determine the visible surface at each pixel.
➢ Depth values for pixel are compared and smallest z value determines the color or surface
to be displayed
➢ To override the closer polygons from the far ones using two buffers: Frame buffer & Depth
Buffer
➢ Frame buffer – store the intensity value of color; Depth buffer – Depth value for (x,y) position
➢ It is an image-space method to identify visible surface
➢ This method has a depth information for only single scan-line. In order to require one
scan-line of depth values, we must group and process all polygons intersecting a given
scan-line at the same time before processing the next scan-line
➢Two important tables, edge table and polygon table are maintained for this.
➢ Edge Table − It contains coordinate endpoints of each line in the scene, the inverse
slope of each line, and pointers into the polygon table to connect edges to surfaces.
➢ Polygon Table − It contains the plane coefficients surface material properties,
other surface data, and may be pointers to the edge table
Side effects of Scan Conversion:
1. Staircase or Jagged:
Staircase like appearance is seen while the scan was converting line or circle.
2. Unequal Intensity: It deals with unequal appearance of the brightness of different
lines. An inclined line appears less bright as compared to the horizontal and vertical
line.
Farthest polygon
Object precision
• Object are not flat all the time so we need to draw curves many times to draw an object
Types of Curves:
• Curve is indefinitely large set of points
•Each point has two neighbors except End point
i. Implicit Curves:
• If the point is present on the curve, it is said to be Implicit Curves
f(x,y) = 0 where f is a scalar
Ex: X2 + y2 – r2 = 0 => Circle Function returns a single real numbers
ii. Explicit Curves:
• y = f(x)
Ex: y = mx + c
iii. Parametric Curves:
• Most computer graphics uses this type of curve
2D: 3D:
P(t)=f(t), g(t) 0r x(t), y(t) where P(t)=f(t), g(t),h(t) 0r x(t), y(t) ,z(t)
0<t<1 ; t- parameter where 0<t<1 ; t- parameter
 Bezier Curve is parametric curve defined by a set of control points.
 Two points are ends of the curve.
 Other points determine the shape of the curve.
 Used in drawing packages and CAD Applications

This bezier curve is defined by a


set of control points b0, b1, b2 and
[Link] b0 and b3 are ends of the
curve. Points b1 and b2 determine
the shape of the curve.
 The simplest Bezier curve is the straight line from the point P0 to
P1.
 A quadratic Bezier curve is determined by three control points.
 A cubic Bezier curve is determined by four control points

Cubic Bezier curve equation:


Reference: [Link]
❑ Property 1:
Bezier curve always contained within a polygon called as convex hull of its control points

❑ Property 2:
✓ They generally follow the shape of the control polygon, which consists of the segments
joining the control points.
✓ They always pass through the first and last control points.

❑ Property 3:
✓ The degree of the polynomial defining the curve segment is one less that the number of
defining polygon point. Therefore, for 4 control points, the degree of the polynomial is 3,
i.e. cubic polynomial.
Degree= Number of Control points - 1
❑ Property 4:
The order of the polynomial defining the curve segment is equal to the total number of
control points.
Order = Number of Control Points

❑ Property 5:
✓ Bezier curves exhibit global control means moving a control point alters the shape of the
whole curve. (points are not always on curve)
✓ Bezier curve are generated using the concept of approximation.
✓The curve line within the convex hull of its defining polygon.
✓Each basis function is positive or zero for all parameter values.
✓The maximum order of the curve is equal to the number of vertices of defining polygon.
✓The curve generally follows the shape of defining polygon.
✓The degree of B-spline polynomial is independent on the number of vertices of defining
Polygon
✓B-spline allows the local control over the curve surface because each vertex affects the shape
of a curve only over a range of parameter values where its associated basis function is nonzero.

B-Bias
t-tension
P0=(-2,0);P1=(-2,4);p2=(2,4);and P3=(2,0).

A. Bezier curve P(t) has degree 3 - True C. Bezier curve P(t) may extend
outside the convex hull of its control
Property 3: points – False
Degree= Number of Control points – 1
Property 1: Bezier curve always
Degree = 4 – 1 = 3 contained within a polygon called as
convex hull of its control points

B. P(1/2) = (0,3) - True


Cubic Bezier curve equation:
P(0.5)=[-2 0] (1-0.5)3 + [-2 4] 3x0.5 (1-0.5)2 + [2 4] 3x(0.5)2 (1-0.5) + [2 0] (0.5)3
= [-2 0] (0.5)3 + [-2 4] 3x0.5 (0.5)2 + [2 4] 3x(0.5)2 (0.5) + [2 0] (0.5)3
= [-2 0] (0.125) + [-2 4] 3x0.5 (0.25) + [2 4] 3x(0.25) (0.5) + [2 0] (0.125)
= [-2 0] (0.125) + [-2 4] (0.375) + [2 4] (0.375) + [2 0] (0.125)
= [-2 0] (0.125) + [-2 4] (0.375) + [2 4] (0.375) + [2 0] (0.125)
=[-0.25 0] + [-0.75 1.5] + [ 0.75 1.5] + [0.25 0]
= [ 0 3]
In ________ curve the last and the first vertices of the
polygon lie on the curve and all other vertices define the
derivatives, order and shape of the curve
a. B-Spline Curve
b. Boxline Curve
c. Bezier Curve
d. Gaussian Curve
In ________ curve the last and the first vertices of the
polygon lie on the curve and all other vertices define the
derivatives, order and shape of the curve
a. B-Spline Curve
b. Boxline Curve
c. Bezier Curve
d. Gaussian Curve
Projection are defined as mapping of three-dimensional points to a two-dimensional plane.
There are two type of projection parallel and perspective.

Top
Side Front

You might also like