SlideShare a Scribd company logo
Assignment No.2
Submitted To:
Ma’am Aqsa Naeem
Subject:
Computer Graphics
Topics:
 Transformation
 2D transformation
 Basic Types of transformation
 Translation
 Rotation
 Scaling
 Composite Transformation
 Window to viewport Transformation
Submitted By
Name:
Asma Tehseen
Roll No
1823110013 (319)
Class
BSCS-IV
Submission Date:
18th
may, 2020
Department of Computer Science
Transformation
“In graphics, transformation means to change described
object by moving, rotating or scaling that object while following
some specific rules.”
Or
“A transformation is any operation on a point in a space (x,y)
that maps the point’s coordinates into a new set of coordinates
i. e; (x1,y1).”
Simply moves an object from one position to another following this
equation:
dyyy
dxxx
oldnew
oldnew


2D Transformation
“The transformation takes place in 2D plane to re-position
graphics, size or orientation of an object on screen is known as
2D Transformation.”
Types of Transformation:
There are several types of basic transformations:
 Translation
 Rotation
 Scale
Translation:
“A translation is applied to an object by re-positioning it along a
straight line path from one coordinate location to another.”
In 2D Translation, a point moves to a specified distance in the x or y
direction.
It is performed by adding translation distances,tx and ty to the original
coordinate position (x,y) to move the point to a new position (x’,y’)
yty
x


'
x
'
y
tx
The translation distance pair (tx, ty) is called a translation vector or
shift vector.
In translation, deformation of image does not occur as every point on the
object is translated by the same amount.
Translation equation in matrix form is represented as:







2
1
x
x
P 






2
1
'
'
'
x
x
P 






y
x
t
t
T
Row vector form:
 yxP  yx ttT
P=(x,y)
P1=(2,3) , P2=(1,1) , P3=(3,1)
While translation T=(tx,ty) is at (5,3)
For P = (2,3)
P’1= (2,3) + (5,3) = (7,6)
P’2= (1,1) + (5,3) = (6,4)
P’3= (3,1) + (5,3) = (8,4)
y
X
(0,0)
1
1
2
2
3 4 5 6 7 8 9 1
3
4
5
6P1(2,3)
P2(1,1) P3(3,1)
y
x
1
2
3
4
5
6
(6,4)
(8,4)
(7,6)
Where
P’ = P + T
Translated by (5, 3)
X’ = x + dx
y’ = y + dy
P’ = (x’ , y’)
x’ = x + tx
y’ = y + ty
Rotation:
“A two dimensional rotation is applied on an object by
re-positioning it along a circular path in the xy plane.”
It causes a point to be moved relative to a central point, without changing
the distance of r from the central point. While, Rotation angle θ and
Rotation point (xr,yr) are specified to generate rotation.
Rotation point is the point about which the object will rotate also known
as pivot point.
Positive values of rotation angle define counterclockwise rotations about
the rotation point and Negative values indicate the rotation in clockwise
direction.
For the equation of rotation, r is the constant distance of the point form
the origin, angle Φ is the original angular position and θ is the rotational
angle.
 sinsincoscos)cos(' rrrx 
 cossinsincos)sin(' rrry 
Original coordinates of the point are:
cosrx  sinry 
By equation 1


cossin'
sincos'
yxy
yxx


In column vector form rotation is defined as: P’=R.P
Where rotation matrix is:





 



cossin
sincos
R
For positive rotation it becomes: For negative rotation:





 



cossin
sincos
R 








cossin-
sincos
R
1
(x,y)
(x’,y’)
r
r
Φ
θ
Rotation is also a rigid body transformation, as image deformation doesn't
occur. Since, every point on the object is rotated through the same angle.
Scaling
“This transformation alters the size and possibly the position of object.”
Scaling operation is performed by multiplying the coordinate values (x,y)
of each vertex by scaling factors sx and sy to produce the transformed
coordinates (x’,y’).
y
x
syy
sxx
.'
.'


sx scales the object in x direction and sy scales the object in y direction
P’ = S.P
Scaling factors(sx, sy)can be assigned any +ve numeric values.
 Values less than 1deduce the size of the objects
 Values greater than 1 produce an enlargement
 1 value for both does not make any changes to the size of the object
In Matrix form:


















y
x
s
s
y
x
y
x
.
0
0
'
'
The location of a scaled object can be controlled by choosing a position,
called the fixed point, that is to remain unchanged after the scaling
transformation.while,the Coordinates for the fixed point (xf, yf) can be
chosen as one of the vertices, the object centroid, or any other position.
Object is rotated at
Rotational angle θ
from
Original angle Φ
Scale by (2, 2)
P = (x, y) P’=(x’,y’) ; S = (2,2)
P1=(2,3) P’1 =(2,3).(2,2)=(4,6)
P2=(1,1) P’2=(1,1).(2,2) =(2,2)
P3=(3,1) P’3=(3,1).(2,2)=(6,2)
Composite Transformation
Composite transformation is achieved by concatenation of two
or more transformation matrices to obtained a combined
transformation matrix.
i. e; composite Transformation matrix.matrix
Operations perform in Composite transformation:
Rotate about an arbitrary point translate,rotate,translate
Scale about an arbitrary point translate, scale,translate
Change Co-ordinate system translate, rotate, scale
y
0 1
1
2
2
3 4 5 6 7 8 9 1
3
4
5
6
(2, 3)
(1, 1) (3,1)
x’ = sx*x
y’ = sy*y
y
0 1
1
2
2
3 4 5 6 7 8 9 10
3
4
5
6
(2, 2) (6, 2)
(4,6)
Since, the composite transformations are as follows:
 Composite Translation:
The two successive translation vectors (tx1, tyl) and (tx2, ty2)
are applied to a coordinate position P, the final transformed location
P' is calculated as
P’=[T{tx2,ty2}.T{tx1,ty1}].P
In matrix form

































100
tyty10
txtx01
100
ty10
tx01
.
100
ty10
tx01
12
12
1
1
2
2
Hence, two successive translations are additive.
 Composite Rotation
Two successive rotations applied to point p product the transformed
position
P' = {R(θ2) . R(θ1) }. P
By multiplying the two rotation matrices, we can verify that two
successive rotations are additive
PRP
PRRP
)..('
).().('
12
12




so that the final rotated coordinates with the composite rotation matrix is












100
0)21cos()21sin(
0)21sin(-)21cos(


 Composite Scaling
Concatenating transformation matrices for two successive scaling
operations produces the following composite scaling matrix:































100
0Sy.Sy0
00Sx.Sx
100
0Sy0
00Sx
.
100
0Sy0
00Sx
1
1
2
2
OR
).,.().()..( 21211122 sysysxsxSsysxSsysxS 
The resulting matrix indicates that successive scaling operations are
multiplicative. To triple the size of an object twice in succession, then the
final size would be nine times of original object.
Window to Viewport Transformation
“The process of transforming a two dimensional, world
coordinate scene into device coordinates.”
In particular, object inside world or clipping window are
mapped to viewport.
Clipping window Viewport
Purpose:
The purpose of this transformation is to convert the size of clipping
window to size of viewport by using some mathematical computations.
Steps for window to viewport transformation:
1. Translate window towards origin i.e; lower left corner and upper
left corner of window become negative.
2. Resize window to viewport size applying following computation
minmax
minmax
x
XWXW
XVXV
S


 &
minmax
minmax
ywyw
yvyv
Sy



3. Translate window I.e; position of window and viewport is same.
i. if viewport is at(0,0) then don’t translate because window is
already at origin.
ii. If viewport is not at (0,0) take translation factor positive.
World port/clipping window:
The part of world
coordinate to be displayed on
screen.
Viewport:
Rectangular region
selected for displaying image
on computer screen.
YW-max
YW-min
XW-min XW-max
Viewport Coordinate
YV-max
YV-min
XV-min XV-max
Window in
world coordinate
Window translated
to Origin
Window scaled to size
of viewport
Translated by (xmin,ymin)
to final position
(Xmax,Ymax)
(Xmin,Ymin)
(Xmin,Ymin)
(Xmax.Ymax)
Mathematical Computation:













































100
y-10
x-01
.
100
0
yy
vv
0
00
x-x
u-u
.
100
v10
u01
)y-,T(-x).,
x-x
u-u
).S(v,T(u
vieporttowindowofMapping
)v,T(u
viewportofnTranslatio
),
x-x
u-u
S(
viewporttowindowofScaling
)y-,T(-x
windowofanslationrT
min
min
minmax
minmax
minmax
minmax
min
min
minmin
minmax
minmax
minmax
minmax
minmax
minmax
minmax
minmax
minmax
minmax
minmin
yy
vv
yy
vv

More Related Content

What's hot

Raster scan system
Raster scan systemRaster scan system
Raster scan system
Mohd Arif
 
2D Transformations(Computer Graphics)
2D Transformations(Computer Graphics)2D Transformations(Computer Graphics)
2D Transformations(Computer Graphics)
AditiPatni3
 
Intensity Transformation and Spatial filtering
Intensity Transformation and Spatial filteringIntensity Transformation and Spatial filtering
Intensity Transformation and Spatial filtering
Shajun Nisha
 
Line drawing algo.
Line drawing algo.Line drawing algo.
Line drawing algo.
Mohd Arif
 
Dda algorithm
Dda algorithmDda algorithm
Dda algorithm
Mani Kanth
 
2D viewing & clipping
2D viewing & clipping2D viewing & clipping
2D viewing & clipping
MdAlAmin187
 
BRESENHAM’S LINE DRAWING ALGORITHM
BRESENHAM’S  LINE DRAWING ALGORITHMBRESENHAM’S  LINE DRAWING ALGORITHM
BRESENHAM’S LINE DRAWING ALGORITHM
St Mary's College,Thrissur,Kerala
 
2D transformation (Computer Graphics)
2D transformation (Computer Graphics)2D transformation (Computer Graphics)
2D transformation (Computer Graphics)
Timbal Mayank
 
Computer graphics iv unit
Computer graphics iv unitComputer graphics iv unit
Computer graphics iv unit
aravindangc
 
Computer graphics basic transformation
Computer graphics basic transformationComputer graphics basic transformation
Computer graphics basic transformation
Selvakumar Gna
 
Computer Graphic - Transformations in 2D
Computer Graphic - Transformations in 2DComputer Graphic - Transformations in 2D
Computer Graphic - Transformations in 2D
2013901097
 
COMPUTER GRAPHICS-"Projection"
COMPUTER GRAPHICS-"Projection"COMPUTER GRAPHICS-"Projection"
COMPUTER GRAPHICS-"Projection"
Ankit Surti
 
Ellipses drawing algo.
Ellipses drawing algo.Ellipses drawing algo.
Ellipses drawing algo.
Mohd Arif
 
1. Introduction of Computer Graphics
1. Introduction of Computer Graphics1. Introduction of Computer Graphics
1. Introduction of Computer Graphics
Aparna Joshi
 
3d transformation computer graphics
3d transformation computer graphics 3d transformation computer graphics
3d transformation computer graphics
University of Potsdam
 
Back face detection
Back face detectionBack face detection
Back face detection
Pooja Dixit
 
Image processing second unit Notes
Image processing second unit NotesImage processing second unit Notes
Image processing second unit Notes
AAKANKSHA JAIN
 
3D transformation in computer graphics
3D transformation in computer graphics3D transformation in computer graphics
3D transformation in computer graphics
SHIVANI SONI
 
Cs8092 computer graphics and multimedia unit 4
Cs8092 computer graphics and multimedia unit 4Cs8092 computer graphics and multimedia unit 4
Cs8092 computer graphics and multimedia unit 4
SIMONTHOMAS S
 
BTech Pattern Recognition Notes
BTech Pattern Recognition NotesBTech Pattern Recognition Notes
BTech Pattern Recognition Notes
Ashutosh Agrahari
 

What's hot (20)

Raster scan system
Raster scan systemRaster scan system
Raster scan system
 
2D Transformations(Computer Graphics)
2D Transformations(Computer Graphics)2D Transformations(Computer Graphics)
2D Transformations(Computer Graphics)
 
Intensity Transformation and Spatial filtering
Intensity Transformation and Spatial filteringIntensity Transformation and Spatial filtering
Intensity Transformation and Spatial filtering
 
Line drawing algo.
Line drawing algo.Line drawing algo.
Line drawing algo.
 
Dda algorithm
Dda algorithmDda algorithm
Dda algorithm
 
2D viewing & clipping
2D viewing & clipping2D viewing & clipping
2D viewing & clipping
 
BRESENHAM’S LINE DRAWING ALGORITHM
BRESENHAM’S  LINE DRAWING ALGORITHMBRESENHAM’S  LINE DRAWING ALGORITHM
BRESENHAM’S LINE DRAWING ALGORITHM
 
2D transformation (Computer Graphics)
2D transformation (Computer Graphics)2D transformation (Computer Graphics)
2D transformation (Computer Graphics)
 
Computer graphics iv unit
Computer graphics iv unitComputer graphics iv unit
Computer graphics iv unit
 
Computer graphics basic transformation
Computer graphics basic transformationComputer graphics basic transformation
Computer graphics basic transformation
 
Computer Graphic - Transformations in 2D
Computer Graphic - Transformations in 2DComputer Graphic - Transformations in 2D
Computer Graphic - Transformations in 2D
 
COMPUTER GRAPHICS-"Projection"
COMPUTER GRAPHICS-"Projection"COMPUTER GRAPHICS-"Projection"
COMPUTER GRAPHICS-"Projection"
 
Ellipses drawing algo.
Ellipses drawing algo.Ellipses drawing algo.
Ellipses drawing algo.
 
1. Introduction of Computer Graphics
1. Introduction of Computer Graphics1. Introduction of Computer Graphics
1. Introduction of Computer Graphics
 
3d transformation computer graphics
3d transformation computer graphics 3d transformation computer graphics
3d transformation computer graphics
 
Back face detection
Back face detectionBack face detection
Back face detection
 
Image processing second unit Notes
Image processing second unit NotesImage processing second unit Notes
Image processing second unit Notes
 
3D transformation in computer graphics
3D transformation in computer graphics3D transformation in computer graphics
3D transformation in computer graphics
 
Cs8092 computer graphics and multimedia unit 4
Cs8092 computer graphics and multimedia unit 4Cs8092 computer graphics and multimedia unit 4
Cs8092 computer graphics and multimedia unit 4
 
BTech Pattern Recognition Notes
BTech Pattern Recognition NotesBTech Pattern Recognition Notes
BTech Pattern Recognition Notes
 

Similar to 2D Transformation

06.Transformation.ppt
06.Transformation.ppt06.Transformation.ppt
06.Transformation.ppt
RobinAhmedSaikat
 
2D Transformation
2D Transformation2D Transformation
2D Transformation
ShahDhruv21
 
2 d transformations by amit kumar (maimt)
2 d transformations by amit kumar (maimt)2 d transformations by amit kumar (maimt)
2 d transformations by amit kumar (maimt)
Amit Kapoor
 
2 d geometric transformations
2 d geometric transformations2 d geometric transformations
2 d geometric transformations
Mohd Arif
 
Computer Graphics Unit 2
Computer Graphics Unit 2Computer Graphics Unit 2
Computer Graphics Unit 2
aravindangc
 
Unit 3 notes
Unit 3 notesUnit 3 notes
Unit 3 notes
Balamurugan M
 
Unit-3 overview of transformations
Unit-3 overview of transformationsUnit-3 overview of transformations
Unit-3 overview of transformations
Amol Gaikwad
 
Two dimentional transform
Two dimentional transformTwo dimentional transform
Two dimentional transform
Patel Punit
 
Computer graphics presentation
Computer graphics presentationComputer graphics presentation
Computer graphics presentation
Daffodil International University
 
2 d translation
2 d translation2 d translation
2 d translation
Mani Kanth
 
Lecture 6-1543909797
Lecture 6-1543909797Lecture 6-1543909797
Lecture 6-1543909797
Canh Le
 
transformation IT.ppt
transformation IT.ppttransformation IT.ppt
transformation IT.ppt
ShubhamBatwani
 
Two dimensionaltransformations
Two dimensionaltransformationsTwo dimensionaltransformations
Two dimensionaltransformations
Nareek
 
Bla b__________________la -2&3d -DD .ppt
Bla b__________________la -2&3d -DD .pptBla b__________________la -2&3d -DD .ppt
Bla b__________________la -2&3d -DD .ppt
kdemersal
 
2d transformation
2d transformation2d transformation
2d transformation
Sarkunavathi Aribal
 
Three dimensional geometric transformations
Three dimensional geometric transformationsThree dimensional geometric transformations
Three dimensional geometric transformations
shanthishyam
 
2 d transformation
2 d transformation2 d transformation
2 d transformation
Ankit Garg
 
Intro to scan conversion
Intro to scan conversionIntro to scan conversion
Intro to scan conversion
Mohd Arif
 
2d-transformation
2d-transformation2d-transformation
2d-transformation
Pooja Dixit
 
2Dand3D transformationppt.pptx
2Dand3D transformationppt.pptx2Dand3D transformationppt.pptx
2Dand3D transformationppt.pptx
RAMESHCHANDRANE
 

Similar to 2D Transformation (20)

06.Transformation.ppt
06.Transformation.ppt06.Transformation.ppt
06.Transformation.ppt
 
2D Transformation
2D Transformation2D Transformation
2D Transformation
 
2 d transformations by amit kumar (maimt)
2 d transformations by amit kumar (maimt)2 d transformations by amit kumar (maimt)
2 d transformations by amit kumar (maimt)
 
2 d geometric transformations
2 d geometric transformations2 d geometric transformations
2 d geometric transformations
 
Computer Graphics Unit 2
Computer Graphics Unit 2Computer Graphics Unit 2
Computer Graphics Unit 2
 
Unit 3 notes
Unit 3 notesUnit 3 notes
Unit 3 notes
 
Unit-3 overview of transformations
Unit-3 overview of transformationsUnit-3 overview of transformations
Unit-3 overview of transformations
 
Two dimentional transform
Two dimentional transformTwo dimentional transform
Two dimentional transform
 
Computer graphics presentation
Computer graphics presentationComputer graphics presentation
Computer graphics presentation
 
2 d translation
2 d translation2 d translation
2 d translation
 
Lecture 6-1543909797
Lecture 6-1543909797Lecture 6-1543909797
Lecture 6-1543909797
 
transformation IT.ppt
transformation IT.ppttransformation IT.ppt
transformation IT.ppt
 
Two dimensionaltransformations
Two dimensionaltransformationsTwo dimensionaltransformations
Two dimensionaltransformations
 
Bla b__________________la -2&3d -DD .ppt
Bla b__________________la -2&3d -DD .pptBla b__________________la -2&3d -DD .ppt
Bla b__________________la -2&3d -DD .ppt
 
2d transformation
2d transformation2d transformation
2d transformation
 
Three dimensional geometric transformations
Three dimensional geometric transformationsThree dimensional geometric transformations
Three dimensional geometric transformations
 
2 d transformation
2 d transformation2 d transformation
2 d transformation
 
Intro to scan conversion
Intro to scan conversionIntro to scan conversion
Intro to scan conversion
 
2d-transformation
2d-transformation2d-transformation
2d-transformation
 
2Dand3D transformationppt.pptx
2Dand3D transformationppt.pptx2Dand3D transformationppt.pptx
2Dand3D transformationppt.pptx
 

Recently uploaded

PIMS Job Advertisement 2024.pdf Islamabad
PIMS Job Advertisement 2024.pdf IslamabadPIMS Job Advertisement 2024.pdf Islamabad
PIMS Job Advertisement 2024.pdf Islamabad
AyyanKhan40
 
The Diamonds of 2023-2024 in the IGRA collection
The Diamonds of 2023-2024 in the IGRA collectionThe Diamonds of 2023-2024 in the IGRA collection
The Diamonds of 2023-2024 in the IGRA collection
Israel Genealogy Research Association
 
বাংলাদেশ অর্থনৈতিক সমীক্ষা (Economic Review) ২০২৪ UJS App.pdf
বাংলাদেশ অর্থনৈতিক সমীক্ষা (Economic Review) ২০২৪ UJS App.pdfবাংলাদেশ অর্থনৈতিক সমীক্ষা (Economic Review) ২০২৪ UJS App.pdf
বাংলাদেশ অর্থনৈতিক সমীক্ষা (Economic Review) ২০২৪ UJS App.pdf
eBook.com.bd (প্রয়োজনীয় বাংলা বই)
 
Digital Artifact 1 - 10VCD Environments Unit
Digital Artifact 1 - 10VCD Environments UnitDigital Artifact 1 - 10VCD Environments Unit
Digital Artifact 1 - 10VCD Environments Unit
chanes7
 
The basics of sentences session 6pptx.pptx
The basics of sentences session 6pptx.pptxThe basics of sentences session 6pptx.pptx
The basics of sentences session 6pptx.pptx
heathfieldcps1
 
Exploiting Artificial Intelligence for Empowering Researchers and Faculty, In...
Exploiting Artificial Intelligence for Empowering Researchers and Faculty, In...Exploiting Artificial Intelligence for Empowering Researchers and Faculty, In...
Exploiting Artificial Intelligence for Empowering Researchers and Faculty, In...
Dr. Vinod Kumar Kanvaria
 
The simplified electron and muon model, Oscillating Spacetime: The Foundation...
The simplified electron and muon model, Oscillating Spacetime: The Foundation...The simplified electron and muon model, Oscillating Spacetime: The Foundation...
The simplified electron and muon model, Oscillating Spacetime: The Foundation...
RitikBhardwaj56
 
ANATOMY AND BIOMECHANICS OF HIP JOINT.pdf
ANATOMY AND BIOMECHANICS OF HIP JOINT.pdfANATOMY AND BIOMECHANICS OF HIP JOINT.pdf
ANATOMY AND BIOMECHANICS OF HIP JOINT.pdf
Priyankaranawat4
 
BÀI TẬP BỔ TRỢ TIẾNG ANH 8 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2023-2024 (CÓ FI...
BÀI TẬP BỔ TRỢ TIẾNG ANH 8 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2023-2024 (CÓ FI...BÀI TẬP BỔ TRỢ TIẾNG ANH 8 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2023-2024 (CÓ FI...
BÀI TẬP BỔ TRỢ TIẾNG ANH 8 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2023-2024 (CÓ FI...
Nguyen Thanh Tu Collection
 
Liberal Approach to the Study of Indian Politics.pdf
Liberal Approach to the Study of Indian Politics.pdfLiberal Approach to the Study of Indian Politics.pdf
Liberal Approach to the Study of Indian Politics.pdf
WaniBasim
 
How to Build a Module in Odoo 17 Using the Scaffold Method
How to Build a Module in Odoo 17 Using the Scaffold MethodHow to Build a Module in Odoo 17 Using the Scaffold Method
How to Build a Module in Odoo 17 Using the Scaffold Method
Celine George
 
South African Journal of Science: Writing with integrity workshop (2024)
South African Journal of Science: Writing with integrity workshop (2024)South African Journal of Science: Writing with integrity workshop (2024)
South African Journal of Science: Writing with integrity workshop (2024)
Academy of Science of South Africa
 
How to Fix the Import Error in the Odoo 17
How to Fix the Import Error in the Odoo 17How to Fix the Import Error in the Odoo 17
How to Fix the Import Error in the Odoo 17
Celine George
 
Pollock and Snow "DEIA in the Scholarly Landscape, Session One: Setting Expec...
Pollock and Snow "DEIA in the Scholarly Landscape, Session One: Setting Expec...Pollock and Snow "DEIA in the Scholarly Landscape, Session One: Setting Expec...
Pollock and Snow "DEIA in the Scholarly Landscape, Session One: Setting Expec...
National Information Standards Organization (NISO)
 
Assessment and Planning in Educational technology.pptx
Assessment and Planning in Educational technology.pptxAssessment and Planning in Educational technology.pptx
Assessment and Planning in Educational technology.pptx
Kavitha Krishnan
 
RPMS TEMPLATE FOR SCHOOL YEAR 2023-2024 FOR TEACHER 1 TO TEACHER 3
RPMS TEMPLATE FOR SCHOOL YEAR 2023-2024 FOR TEACHER 1 TO TEACHER 3RPMS TEMPLATE FOR SCHOOL YEAR 2023-2024 FOR TEACHER 1 TO TEACHER 3
RPMS TEMPLATE FOR SCHOOL YEAR 2023-2024 FOR TEACHER 1 TO TEACHER 3
IreneSebastianRueco1
 
How to Manage Your Lost Opportunities in Odoo 17 CRM
How to Manage Your Lost Opportunities in Odoo 17 CRMHow to Manage Your Lost Opportunities in Odoo 17 CRM
How to Manage Your Lost Opportunities in Odoo 17 CRM
Celine George
 
A Survey of Techniques for Maximizing LLM Performance.pptx
A Survey of Techniques for Maximizing LLM Performance.pptxA Survey of Techniques for Maximizing LLM Performance.pptx
A Survey of Techniques for Maximizing LLM Performance.pptx
thanhdowork
 
clinical examination of hip joint (1).pdf
clinical examination of hip joint (1).pdfclinical examination of hip joint (1).pdf
clinical examination of hip joint (1).pdf
Priyankaranawat4
 
The basics of sentences session 5pptx.pptx
The basics of sentences session 5pptx.pptxThe basics of sentences session 5pptx.pptx
The basics of sentences session 5pptx.pptx
heathfieldcps1
 

Recently uploaded (20)

PIMS Job Advertisement 2024.pdf Islamabad
PIMS Job Advertisement 2024.pdf IslamabadPIMS Job Advertisement 2024.pdf Islamabad
PIMS Job Advertisement 2024.pdf Islamabad
 
The Diamonds of 2023-2024 in the IGRA collection
The Diamonds of 2023-2024 in the IGRA collectionThe Diamonds of 2023-2024 in the IGRA collection
The Diamonds of 2023-2024 in the IGRA collection
 
বাংলাদেশ অর্থনৈতিক সমীক্ষা (Economic Review) ২০২৪ UJS App.pdf
বাংলাদেশ অর্থনৈতিক সমীক্ষা (Economic Review) ২০২৪ UJS App.pdfবাংলাদেশ অর্থনৈতিক সমীক্ষা (Economic Review) ২০২৪ UJS App.pdf
বাংলাদেশ অর্থনৈতিক সমীক্ষা (Economic Review) ২০২৪ UJS App.pdf
 
Digital Artifact 1 - 10VCD Environments Unit
Digital Artifact 1 - 10VCD Environments UnitDigital Artifact 1 - 10VCD Environments Unit
Digital Artifact 1 - 10VCD Environments Unit
 
The basics of sentences session 6pptx.pptx
The basics of sentences session 6pptx.pptxThe basics of sentences session 6pptx.pptx
The basics of sentences session 6pptx.pptx
 
Exploiting Artificial Intelligence for Empowering Researchers and Faculty, In...
Exploiting Artificial Intelligence for Empowering Researchers and Faculty, In...Exploiting Artificial Intelligence for Empowering Researchers and Faculty, In...
Exploiting Artificial Intelligence for Empowering Researchers and Faculty, In...
 
The simplified electron and muon model, Oscillating Spacetime: The Foundation...
The simplified electron and muon model, Oscillating Spacetime: The Foundation...The simplified electron and muon model, Oscillating Spacetime: The Foundation...
The simplified electron and muon model, Oscillating Spacetime: The Foundation...
 
ANATOMY AND BIOMECHANICS OF HIP JOINT.pdf
ANATOMY AND BIOMECHANICS OF HIP JOINT.pdfANATOMY AND BIOMECHANICS OF HIP JOINT.pdf
ANATOMY AND BIOMECHANICS OF HIP JOINT.pdf
 
BÀI TẬP BỔ TRỢ TIẾNG ANH 8 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2023-2024 (CÓ FI...
BÀI TẬP BỔ TRỢ TIẾNG ANH 8 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2023-2024 (CÓ FI...BÀI TẬP BỔ TRỢ TIẾNG ANH 8 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2023-2024 (CÓ FI...
BÀI TẬP BỔ TRỢ TIẾNG ANH 8 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2023-2024 (CÓ FI...
 
Liberal Approach to the Study of Indian Politics.pdf
Liberal Approach to the Study of Indian Politics.pdfLiberal Approach to the Study of Indian Politics.pdf
Liberal Approach to the Study of Indian Politics.pdf
 
How to Build a Module in Odoo 17 Using the Scaffold Method
How to Build a Module in Odoo 17 Using the Scaffold MethodHow to Build a Module in Odoo 17 Using the Scaffold Method
How to Build a Module in Odoo 17 Using the Scaffold Method
 
South African Journal of Science: Writing with integrity workshop (2024)
South African Journal of Science: Writing with integrity workshop (2024)South African Journal of Science: Writing with integrity workshop (2024)
South African Journal of Science: Writing with integrity workshop (2024)
 
How to Fix the Import Error in the Odoo 17
How to Fix the Import Error in the Odoo 17How to Fix the Import Error in the Odoo 17
How to Fix the Import Error in the Odoo 17
 
Pollock and Snow "DEIA in the Scholarly Landscape, Session One: Setting Expec...
Pollock and Snow "DEIA in the Scholarly Landscape, Session One: Setting Expec...Pollock and Snow "DEIA in the Scholarly Landscape, Session One: Setting Expec...
Pollock and Snow "DEIA in the Scholarly Landscape, Session One: Setting Expec...
 
Assessment and Planning in Educational technology.pptx
Assessment and Planning in Educational technology.pptxAssessment and Planning in Educational technology.pptx
Assessment and Planning in Educational technology.pptx
 
RPMS TEMPLATE FOR SCHOOL YEAR 2023-2024 FOR TEACHER 1 TO TEACHER 3
RPMS TEMPLATE FOR SCHOOL YEAR 2023-2024 FOR TEACHER 1 TO TEACHER 3RPMS TEMPLATE FOR SCHOOL YEAR 2023-2024 FOR TEACHER 1 TO TEACHER 3
RPMS TEMPLATE FOR SCHOOL YEAR 2023-2024 FOR TEACHER 1 TO TEACHER 3
 
How to Manage Your Lost Opportunities in Odoo 17 CRM
How to Manage Your Lost Opportunities in Odoo 17 CRMHow to Manage Your Lost Opportunities in Odoo 17 CRM
How to Manage Your Lost Opportunities in Odoo 17 CRM
 
A Survey of Techniques for Maximizing LLM Performance.pptx
A Survey of Techniques for Maximizing LLM Performance.pptxA Survey of Techniques for Maximizing LLM Performance.pptx
A Survey of Techniques for Maximizing LLM Performance.pptx
 
clinical examination of hip joint (1).pdf
clinical examination of hip joint (1).pdfclinical examination of hip joint (1).pdf
clinical examination of hip joint (1).pdf
 
The basics of sentences session 5pptx.pptx
The basics of sentences session 5pptx.pptxThe basics of sentences session 5pptx.pptx
The basics of sentences session 5pptx.pptx
 

2D Transformation

  • 1. Assignment No.2 Submitted To: Ma’am Aqsa Naeem Subject: Computer Graphics Topics:  Transformation  2D transformation  Basic Types of transformation  Translation  Rotation  Scaling  Composite Transformation  Window to viewport Transformation Submitted By Name: Asma Tehseen Roll No 1823110013 (319) Class BSCS-IV Submission Date: 18th may, 2020 Department of Computer Science
  • 2. Transformation “In graphics, transformation means to change described object by moving, rotating or scaling that object while following some specific rules.” Or “A transformation is any operation on a point in a space (x,y) that maps the point’s coordinates into a new set of coordinates i. e; (x1,y1).” Simply moves an object from one position to another following this equation: dyyy dxxx oldnew oldnew   2D Transformation “The transformation takes place in 2D plane to re-position graphics, size or orientation of an object on screen is known as 2D Transformation.” Types of Transformation: There are several types of basic transformations:  Translation  Rotation  Scale Translation: “A translation is applied to an object by re-positioning it along a straight line path from one coordinate location to another.” In 2D Translation, a point moves to a specified distance in the x or y direction. It is performed by adding translation distances,tx and ty to the original coordinate position (x,y) to move the point to a new position (x’,y’)
  • 3. yty x   ' x ' y tx The translation distance pair (tx, ty) is called a translation vector or shift vector. In translation, deformation of image does not occur as every point on the object is translated by the same amount. Translation equation in matrix form is represented as:        2 1 x x P        2 1 ' ' ' x x P        y x t t T Row vector form:  yxP  yx ttT P=(x,y) P1=(2,3) , P2=(1,1) , P3=(3,1) While translation T=(tx,ty) is at (5,3) For P = (2,3) P’1= (2,3) + (5,3) = (7,6) P’2= (1,1) + (5,3) = (6,4) P’3= (3,1) + (5,3) = (8,4) y X (0,0) 1 1 2 2 3 4 5 6 7 8 9 1 3 4 5 6P1(2,3) P2(1,1) P3(3,1) y x 1 2 3 4 5 6 (6,4) (8,4) (7,6) Where P’ = P + T Translated by (5, 3) X’ = x + dx y’ = y + dy P’ = (x’ , y’) x’ = x + tx y’ = y + ty
  • 4. Rotation: “A two dimensional rotation is applied on an object by re-positioning it along a circular path in the xy plane.” It causes a point to be moved relative to a central point, without changing the distance of r from the central point. While, Rotation angle θ and Rotation point (xr,yr) are specified to generate rotation. Rotation point is the point about which the object will rotate also known as pivot point. Positive values of rotation angle define counterclockwise rotations about the rotation point and Negative values indicate the rotation in clockwise direction. For the equation of rotation, r is the constant distance of the point form the origin, angle Φ is the original angular position and θ is the rotational angle.  sinsincoscos)cos(' rrrx   cossinsincos)sin(' rrry  Original coordinates of the point are: cosrx  sinry  By equation 1   cossin' sincos' yxy yxx   In column vector form rotation is defined as: P’=R.P Where rotation matrix is:           cossin sincos R For positive rotation it becomes: For negative rotation:           cossin sincos R          cossin- sincos R 1
  • 5. (x,y) (x’,y’) r r Φ θ Rotation is also a rigid body transformation, as image deformation doesn't occur. Since, every point on the object is rotated through the same angle. Scaling “This transformation alters the size and possibly the position of object.” Scaling operation is performed by multiplying the coordinate values (x,y) of each vertex by scaling factors sx and sy to produce the transformed coordinates (x’,y’). y x syy sxx .' .'   sx scales the object in x direction and sy scales the object in y direction P’ = S.P Scaling factors(sx, sy)can be assigned any +ve numeric values.  Values less than 1deduce the size of the objects  Values greater than 1 produce an enlargement  1 value for both does not make any changes to the size of the object In Matrix form:                   y x s s y x y x . 0 0 ' ' The location of a scaled object can be controlled by choosing a position, called the fixed point, that is to remain unchanged after the scaling transformation.while,the Coordinates for the fixed point (xf, yf) can be chosen as one of the vertices, the object centroid, or any other position. Object is rotated at Rotational angle θ from Original angle Φ
  • 6. Scale by (2, 2) P = (x, y) P’=(x’,y’) ; S = (2,2) P1=(2,3) P’1 =(2,3).(2,2)=(4,6) P2=(1,1) P’2=(1,1).(2,2) =(2,2) P3=(3,1) P’3=(3,1).(2,2)=(6,2) Composite Transformation Composite transformation is achieved by concatenation of two or more transformation matrices to obtained a combined transformation matrix. i. e; composite Transformation matrix.matrix Operations perform in Composite transformation: Rotate about an arbitrary point translate,rotate,translate Scale about an arbitrary point translate, scale,translate Change Co-ordinate system translate, rotate, scale y 0 1 1 2 2 3 4 5 6 7 8 9 1 3 4 5 6 (2, 3) (1, 1) (3,1) x’ = sx*x y’ = sy*y y 0 1 1 2 2 3 4 5 6 7 8 9 10 3 4 5 6 (2, 2) (6, 2) (4,6)
  • 7. Since, the composite transformations are as follows:  Composite Translation: The two successive translation vectors (tx1, tyl) and (tx2, ty2) are applied to a coordinate position P, the final transformed location P' is calculated as P’=[T{tx2,ty2}.T{tx1,ty1}].P In matrix form                                  100 tyty10 txtx01 100 ty10 tx01 . 100 ty10 tx01 12 12 1 1 2 2 Hence, two successive translations are additive.  Composite Rotation Two successive rotations applied to point p product the transformed position P' = {R(θ2) . R(θ1) }. P By multiplying the two rotation matrices, we can verify that two successive rotations are additive PRP PRRP )..(' ).().(' 12 12     so that the final rotated coordinates with the composite rotation matrix is             100 0)21cos()21sin( 0)21sin(-)21cos(    Composite Scaling Concatenating transformation matrices for two successive scaling operations produces the following composite scaling matrix:                                100 0Sy.Sy0 00Sx.Sx 100 0Sy0 00Sx . 100 0Sy0 00Sx 1 1 2 2 OR ).,.().()..( 21211122 sysysxsxSsysxSsysxS  The resulting matrix indicates that successive scaling operations are multiplicative. To triple the size of an object twice in succession, then the final size would be nine times of original object.
  • 8. Window to Viewport Transformation “The process of transforming a two dimensional, world coordinate scene into device coordinates.” In particular, object inside world or clipping window are mapped to viewport. Clipping window Viewport Purpose: The purpose of this transformation is to convert the size of clipping window to size of viewport by using some mathematical computations. Steps for window to viewport transformation: 1. Translate window towards origin i.e; lower left corner and upper left corner of window become negative. 2. Resize window to viewport size applying following computation minmax minmax x XWXW XVXV S    & minmax minmax ywyw yvyv Sy    3. Translate window I.e; position of window and viewport is same. i. if viewport is at(0,0) then don’t translate because window is already at origin. ii. If viewport is not at (0,0) take translation factor positive. World port/clipping window: The part of world coordinate to be displayed on screen. Viewport: Rectangular region selected for displaying image on computer screen. YW-max YW-min XW-min XW-max Viewport Coordinate YV-max YV-min XV-min XV-max Window in world coordinate Window translated to Origin Window scaled to size of viewport Translated by (xmin,ymin) to final position (Xmax,Ymax) (Xmin,Ymin) (Xmin,Ymin) (Xmax.Ymax)