SlideShare a Scribd company logo
Computer Graphics
12/28/16 T.L. SAHU CSE SRIT II RAIPUR 1
• Computer graphics are visual
representations of data displayed on a
monitor made on a computer. Computer
graphics can be a series of images (most
often called video) or a single image.
Transformations
Using Transformation
Parameters reposition and resize
the two dimensional objects
12/28/16 T.L. SAHU CSE SRIT II RAIPUR 2
Contents
12/28/16 T.L. SAHU CSE SRIT II RAIPUR
1. 2D Transformations
2. 2D Translation
3. 2D Scaling
4. 2D Shearing
5. 2D Rotations
3
2D
Transformations
12/28/16 T.L. SAHU CSE SRIT II RAIPUR 4
2D Transformations
Problem:
• Given a 2D object, the transformation is the change
in the object:
– Position (translation)
– Size (scaling)
– Orientation (rotation)
– Shapes (shear)
Solution:
• Construct a sequence of matrices that can be applied
to all the points of the object.12/28/16 T.L. SAHU CSE SRIT II RAIPUR 5
2D Transformations
• World Coordinates
• Translate
• Rotate
• Scale
• Viewport Transforms
• Putting it all together
12/28/16 T.L. SAHU CSE SRIT II RAIPUR 6
Transformations
• Rigid Body Transformations - transformations that do not
change the object.
• Translate
– If you translate a rectangle, it is still a rectangle
• Scale
– If you scale a rectangle, it is still a rectangle
• Rotate
– If you rotate a rectangle, it is still a rectangle
12/28/16 T.L. SAHU CSE SRIT II RAIPUR 7
Vertices
• We have always represented vertices as
(x,y)
• An alternate method is:
• Example:






=
y
x
yx ),(






=
8.4
1.2
)8.4,1.2(
12/28/16 T.L. SAHU CSE SRIT II RAIPUR 8
2D Transformation and Matrices
(Matrix Multiplication)










++
++
++
=










×










ziyhxg
zfyexd
zcybxa
z
y
x
ihg
fed
cba
***
***
***
12/28/16 T.L. SAHU CSE SRIT II RAIPUR
• Representation of points :
• How matrix multiplication takes place:
9
2D
Translations
12/28/16 T.L. SAHU CSE SRIT II RAIPUR 10
Translation
• Translation - repositioning an object along
a straight-line path (the translation
distances) from one coordinate location to
another.
(x,y)
(x’,y’)
(tx,ty)
12/28/16 T.L. SAHU CSE SRIT II RAIPUR 11
Translation
Translation is a process of changing the
position of an object in a straight line path
from one coordinate location to another.
x’= x+tx
y’=y+ty
12/28/16 T.L. SAHU CSE SRIT II RAIPUR 12
Translation: Initial
12/28/16 T.L. SAHU CSE SRIT II RAIPUR 13
Translation: Final
12/28/16 T.L. SAHU CSE SRIT II RAIPUR 14
Translation Operation
12/28/16 T.L. SAHU CSE SRIT II RAIPUR 15
Translation Operation
12/28/16 T.L. SAHU CSE SRIT II RAIPUR
Coordinates:
Matrix Form:
y
x
tyy
txx
+=
+=
'
'






+





=





y
x
t
t
y
x
y
x
'
'
16
Translation
• Given:
• We want:
• Matrix form:
TPP
t
t
y
x
y
x
tyy
txx
ttT
yxP
y
x
y
x
yx
+=






+





=





+=
+=
=
=
'
'
'
'
'
),(
),(
1.4'
4.3'
2.8
1.7
1.4
7.3
'
'
2.81.4'
1.77.3'
)2.8,1.7(
)1.4,7.3(
=
=






+





−
−
=





+−=
+−=
=
−−=
y
x
y
x
y
x
T
P
12/28/16 T.L. SAHU CSE SRIT II RAIPUR 17
Applying to Triangles
(tx,ty)
12/28/16 T.L. SAHU CSE SRIT II RAIPUR 18
2D
Scaling
12/28/16 T.L. SAHU CSE SRIT II RAIPUR 19
Scale
• Scale - Alters the size of an object.
• Scales about a fixed point
(x,y)
(x’,y’)
12/28/16 T.L. SAHU CSE SRIT II RAIPUR 20
Scaling
• A scaling transformation changes the size of an object.
• Any positive numeric values are valid for scaling factor Sx
and Sy.
• Sx and Sy values <1 reduces the size of object.
• Sx and Sy values >1 produce an enlarged object.
• Sx and Sy values =1 size of object does not change.
• Sx = Sy : uniform scaling
• Sx ≠ Sy : differential scaling
12/28/16 T.L. SAHU CSE SRIT II RAIPUR 21
Scaling: Initial
12/28/16 T.L. SAHU CSE SRIT II RAIPUR 22
Scaling: Final
12/28/16 T.L. SAHU CSE SRIT II RAIPUR 23
Scaling Operation
12/28/16 T.L. SAHU CSE SRIT II RAIPUR 24
Scaling Operation
12/28/16 T.L. SAHU CSE SRIT II RAIPUR
Coordinates:
Matrix Form:
y
x
syy
sxx
×=
×=
'
'












=





y
x
s
s
y
x
y
x
0
0
'
'
P(x, y) ->P’ (x’, y’)
P’ -> S . P
25
Non-Uniform/Differential
Scalin’
(x,y)
(x’,y’)
S=(1,2)
12/28/16 T.L. SAHU CSE SRIT II RAIPUR 26
Scale
• Given:
• We want:
• Matrix form:
PSP
y
x
s
s
y
x
ysy
xsx
ssS
yxP
y
x
y
x
yx
⋅=












=





=
=
=
=
'
0
0
'
'
'
'
),(
),(
6.6'
2.4'
2.2
4.1
30
03
'
'
2.2*3'
4.1*3'
)3,3(
)2.2,4.1(
=
=












=





=
=
=
=
y
x
y
x
y
x
S
P
12/28/16 T.L. SAHU CSE SRIT II RAIPUR 27
2D
Rotations
12/28/16 T.L. SAHU CSE SRIT II RAIPUR 28
Rotation
• Rotation - repositions an object along a
circular path.
• Rotation requires an Θ and a pivot point
12/28/16 T.L. SAHU CSE SRIT II RAIPUR 29
Rotation
A two dimensional rotation is applied to an
object by repositioning it along a circular
path in the xy plane. To generate a rotation
angle θ and the position of the rotation
point about object is to be rotated.
12/28/16 T.L. SAHU CSE SRIT II RAIPUR 30
Rotation: Initial
12/28/16 T.L. SAHU CSE SRIT II RAIPUR 31
Rotation: Final
12/28/16 T.L. SAHU CSE SRIT II RAIPUR 32
Rotation: Operation
12/28/16 T.L. SAHU CSE SRIT II RAIPUR 33
Where does it come from?
12/28/16 T.L. SAHU CSE SRIT II RAIPUR 34
Rotation
)cos('
)cos('
sin
cos
)(
),(
Θ+=
Θ+=
=
=
=
=
φ
φ
φ
φ
θ
ry
rx
ry
rx
R
yxP
PRP
y
x
y
x
yxy
yxx
rry
rrx
⋅=











 −
=





+=
−=
+=
−=
'
cossin
sincos
'
'
cossin'
sincos'
cossinsincos'
sinsincoscos'
θθ
θθ
θθ
θθ
θφθφ
θφθφ
12/28/16 T.L. SAHU CSE SRIT II RAIPUR 35
Rotation Operation
12/28/16 T.L. SAHU CSE SRIT II RAIPUR
Coordinates:
Matrix Form:
yxy
yxx
)cos()sin('
)sin()cos('
φφ
φφ
+=
−=











 −
=





y
x
y
x
)cos()sin(
)sin()cos(
'
'
φφ
φφ
P(x, y) ->P’ (x’, y’)
P’ -> R(φ) . P
36
Example
• P=(4,4)
• Θ=45 degrees
12/28/16 T.L. SAHU CSE SRIT II RAIPUR 37
What is the difference? Revisited
V(-0.6,0) V(0,-0.6) V(0.6,0.6)
Translate (1.2,0.3)
V(0,0.6) V(0.3,0.9) V(0,1.2)
Translate (1.2,0.3)
V(0.6,0.3) V(1.2,-0.3) V(1.8,0.9)
V(0,0.6) V(0.3,0.9) V(0,1.2)
12/28/16 T.L. SAHU CSE SRIT II RAIPUR 38
Rotations
V(-0.6,0) V(0,-0.6) V(0.6,0.6)
Rotate -30 degrees
V(0,0.6) V(0.3,0.9) V(0,1.2)
12/28/16 T.L. SAHU CSE SRIT II RAIPUR 39
Combining Transformations
Q: How do we
specify each
transformation?
12/28/16 T.L. SAHU CSE SRIT II RAIPUR 40
Specifying 2D Transformations
• Translation
– T(tx, ty)
– Translation distances
• Scale
– S(sx,sy)
– Scale factors
• Rotation
– R(θ)
– Rotation angle
12/28/16 T.L. SAHU CSE SRIT II RAIPUR 41
Combining Transformations
• Using translate, rotation, and scale, how
do we get:
12/28/16 T.L. SAHU CSE SRIT II RAIPUR 42
Combining Transformations
• Note there are two ways to combine
rotation and translation. Why?
12/28/16 T.L. SAHU CSE SRIT II RAIPUR 43
2D
Shearing
12/28/16 T.L. SAHU CSE SRIT II RAIPUR 44
Shearing
12/28/16 T.L. SAHU CSE SRIT II RAIPUR 45
Shearing Operation
12/28/16 T.L. SAHU CSE SRIT II RAIPUR
Coordinates:
Matrix Form:
xhsyy
yhsxx
yxy
xyx
+×=
+×=
'
'












=





y
x
sh
hs
y
x
yyx
xyx
'
'
46
Combining Transformations
Q: How do we
specify each
transformation?
12/28/16 T.L. SAHU CSE SRIT II RAIPUR 47
Specifying 2D Transformations
• Translation
– T(tx, ty)
– Translation distances
• Scale
– S(sx,sy)
– Scale factors
• Rotation
– R(θ)
– Rotation angle
12/28/16 T.L. SAHU CSE SRIT II RAIPUR 48
Combining Transformations
• Using translate, rotation, and scale, how
do we get:
12/28/16 T.L. SAHU CSE SRIT II RAIPUR 49
Combining Transformations
• Note there are two ways to combine
rotation and translation. Why?
12/28/16 T.L. SAHU CSE SRIT II RAIPUR 50
Rotation about an arbitrary point
cosѳ sinѳ 0
-sinѳ cosѳ 0
-xpcosѳ +ypsinѳ +xp -xpsinѳ-ypcosѳ+yp 1
12/28/16 T.L. SAHU CSE SRIT II RAIPUR
T1.R.T2 =
51
Transformation matrix (original and
reflected image)
1 0 0
0 -1 0
0 0 1
Reflection about x axis
12/28/16 T.L. SAHU CSE SRIT II RAIPUR 52
Transformation matrix (original and
reflected image)
-1 0 0
0 -1 0
0 0 1
Reflection about origin
12/28/16 T.L. SAHU CSE SRIT II RAIPUR 53
Transformation matrix (original and
reflected image)
-1 0 0
0 1 0
0 0 1
Reflection about Y axis
12/28/16 T.L. SAHU CSE SRIT II RAIPUR 54
Transformation matrix (original and
reflected image)
0 1 0
1 0 0
0 0 1
Reflection about line y = x
12/28/16 T.L. SAHU CSE SRIT II RAIPUR 55

More Related Content

PDF
Direct QR factorizations for tall-and-skinny matrices in MapReduce architectu...
PDF
PDF
QR Factorizations and SVDs for Tall-and-skinny Matrices in MapReduce Architec...
PDF
Tall-and-skinny Matrix Computations in MapReduce (ICME colloquium)
PPTX
How to Develop Your Own Simulators for Discrete-Event Systems
PDF
A Multicore Parallelization of Continuous Skyline Queries on Data Streams
PPTX
Computer Graphics Unit 2
PPT
Quick sort Algorithm Discussion And Analysis
Direct QR factorizations for tall-and-skinny matrices in MapReduce architectu...
QR Factorizations and SVDs for Tall-and-skinny Matrices in MapReduce Architec...
Tall-and-skinny Matrix Computations in MapReduce (ICME colloquium)
How to Develop Your Own Simulators for Discrete-Event Systems
A Multicore Parallelization of Continuous Skyline Queries on Data Streams
Computer Graphics Unit 2
Quick sort Algorithm Discussion And Analysis

Viewers also liked (20)

PDF
UX, ethnography and possibilities: for Libraries, Museums and Archives
PPTX
L4 domain integrity
DOCX
PPTX
Ed tech 105a topic 1 history of edtech
PDF
Graphic Design Projects
PPT
Graphic organizers group coaching
PPSX
3D Graphic Designer Freelance
PPT
Lecture 25
PDF
Advance Graphic Design Final Exam 71%
PPT
Graphic Design Intro
PPS
Ome1
DOCX
Chapter 1 introduction to educational technology
PPT
Gaphic design in brand promotion
PPTX
PDF
A way to professional merchandising
PPT
Graphic organizers
PDF
Proper Merchandising & Quality Management System in RMG Sector.
PPSX
Creating Digital Graphic Organizers
PPTX
How To Be A Technical & Smart Merchandiser (Apparel merchandising)
PPTX
Graphic Organizers
UX, ethnography and possibilities: for Libraries, Museums and Archives
L4 domain integrity
Ed tech 105a topic 1 history of edtech
Graphic Design Projects
Graphic organizers group coaching
3D Graphic Designer Freelance
Lecture 25
Advance Graphic Design Final Exam 71%
Graphic Design Intro
Ome1
Chapter 1 introduction to educational technology
Gaphic design in brand promotion
A way to professional merchandising
Graphic organizers
Proper Merchandising & Quality Management System in RMG Sector.
Creating Digital Graphic Organizers
How To Be A Technical & Smart Merchandiser (Apparel merchandising)
Graphic Organizers
Ad

Similar to Transefermation (20)

PPTX
2D Transformation
PPTX
Part 3- Manipulation and Representation of Curves.pptx
PPTX
Part 2- Geometric Transformation.pptx
PPTX
Part 2- Transformation.pptx
PPTX
Two dimensionaltransformations
PPTX
Unit_IV.pptx..............................
PPT
Transformations in Computer Graphics
PPTX
Overview of Transformation in Computer Graphics
PPTX
2d-transformation
PPTX
Lecture 6-1543909797
PPTX
2D and 3D Geometric transformations.pptx
PPTX
CG 5.1 2D Tranvmbnmbjmbjkbsformations.pptx
PPT
Lifting 1
PPTX
seminar on 2D transformation
PPT
Two dimensional_Transformations Notes.ppt
PDF
12handout
PDF
Formations Near The Libration Points: Design Strategies Using Natural And Non...
PPT
Lecture 9-online
PDF
2D Transformation
PPTX
Two dimensional geometric transformation
2D Transformation
Part 3- Manipulation and Representation of Curves.pptx
Part 2- Geometric Transformation.pptx
Part 2- Transformation.pptx
Two dimensionaltransformations
Unit_IV.pptx..............................
Transformations in Computer Graphics
Overview of Transformation in Computer Graphics
2d-transformation
Lecture 6-1543909797
2D and 3D Geometric transformations.pptx
CG 5.1 2D Tranvmbnmbjmbjkbsformations.pptx
Lifting 1
seminar on 2D transformation
Two dimensional_Transformations Notes.ppt
12handout
Formations Near The Libration Points: Design Strategies Using Natural And Non...
Lecture 9-online
2D Transformation
Two dimensional geometric transformation
Ad

Recently uploaded (20)

PPTX
Safety Seminar civil to be ensured for safe working.
PDF
COURSE DESCRIPTOR OF SURVEYING R24 SYLLABUS
PPTX
communication and presentation skills 01
PDF
SMART SIGNAL TIMING FOR URBAN INTERSECTIONS USING REAL-TIME VEHICLE DETECTI...
PPTX
Artificial Intelligence
PDF
August 2025 - Top 10 Read Articles in Network Security & Its Applications
PDF
Categorization of Factors Affecting Classification Algorithms Selection
PPTX
Fundamentals of safety and accident prevention -final (1).pptx
PDF
A SYSTEMATIC REVIEW OF APPLICATIONS IN FRAUD DETECTION
PDF
Influence of Green Infrastructure on Residents’ Endorsement of the New Ecolog...
PDF
EXPLORING LEARNING ENGAGEMENT FACTORS INFLUENCING BEHAVIORAL, COGNITIVE, AND ...
PDF
Soil Improvement Techniques Note - Rabbi
PDF
Exploratory_Data_Analysis_Fundamentals.pdf
PPT
Occupational Health and Safety Management System
PDF
Unit I ESSENTIAL OF DIGITAL MARKETING.pdf
PPTX
Nature of X-rays, X- Ray Equipment, Fluoroscopy
PDF
III.4.1.2_The_Space_Environment.p pdffdf
PPTX
introduction to high performance computing
PPTX
Information Storage and Retrieval Techniques Unit III
PDF
Visual Aids for Exploratory Data Analysis.pdf
Safety Seminar civil to be ensured for safe working.
COURSE DESCRIPTOR OF SURVEYING R24 SYLLABUS
communication and presentation skills 01
SMART SIGNAL TIMING FOR URBAN INTERSECTIONS USING REAL-TIME VEHICLE DETECTI...
Artificial Intelligence
August 2025 - Top 10 Read Articles in Network Security & Its Applications
Categorization of Factors Affecting Classification Algorithms Selection
Fundamentals of safety and accident prevention -final (1).pptx
A SYSTEMATIC REVIEW OF APPLICATIONS IN FRAUD DETECTION
Influence of Green Infrastructure on Residents’ Endorsement of the New Ecolog...
EXPLORING LEARNING ENGAGEMENT FACTORS INFLUENCING BEHAVIORAL, COGNITIVE, AND ...
Soil Improvement Techniques Note - Rabbi
Exploratory_Data_Analysis_Fundamentals.pdf
Occupational Health and Safety Management System
Unit I ESSENTIAL OF DIGITAL MARKETING.pdf
Nature of X-rays, X- Ray Equipment, Fluoroscopy
III.4.1.2_The_Space_Environment.p pdffdf
introduction to high performance computing
Information Storage and Retrieval Techniques Unit III
Visual Aids for Exploratory Data Analysis.pdf

Transefermation