SlideShare a Scribd company logo
2D Transformation
TRANSFORMATION
• Transformation means changing some graphics
into something else by applying rules. We can
have various types of transformations such as
translation, scaling up or down, rotation,
shearing, etc.
• When a transformation takes place on a 2D
plane, it is called 2D transformation.
• Transformations play an important role in
computer graphics to reposition the graphics on
the screen and change their size or orientation.
Homogenous Coordinates
• To perform a sequence of transformation such
as translation followed by rotation and scaling,
we need to follow a sequential process −
• Translate the coordinates,
• Rotate the translated coordinates, and then
• Scale the rotated coordinates to complete the
composite transformation.
Translation
• A translation moves an object to a different
position on the screen.
• You can translate a point in 2D by adding
translation coordinate (tx, ty) to the original
coordinate X, Y to get the new coordinate X′,
Y′.
•
• From the above figure, you can write that −
• X’ = X + tx
• Y’ = Y + ty
• The pair (tx, ty) is called the translation vector
or shift vector. The above equations can also
be represented using the column vectors.
• P=[X] / [Y]
• p' = [X′] / [Y′]
• T = [tx] / [ty]
• We can write it as −
• P’ = P + T
Rotation
• In rotation, we rotate the object at particular
angle θ theta from its origin.
• From the following figure, we can see that the
point PX,Y is located at angle φ from the
horizontal X coordinate with distance r from
the origin.
• Let us suppose you want to rotate it at the
angle θ. After rotating it to a new location, you
will get a new point P’ X′,Y′.
•
• Using standard trigonometric the original coordinate of
point P X,Y can be represented as −
• X=r cosϕ ......(1)
• Y=r sinϕ ......(2)
• Same way we can represent the point P’ X′, Y′ as −
• x′=rcos(ϕ+θ) = rcosϕcosθ − rsinϕsinθ.......(3)
• y′=rsin(ϕ+θ) = rcosϕsinθ + rsinϕcosθ.......(4)
Substituting equation 1 & 2 in 3 & 4 respectively, we will get
x′=xcosθ−ysinθ
y′=xsinθ+ycosθ
• Representing the above equation in matrix
form,
• [X′Y′]=[XY] [cosƟ sinƟ]
[-sinƟ cosƟ] OR
• P’ = P . R
• Where R is the rotation matrix
• R= [cosƟ sinƟ]
[-sinƟ cosƟ]
• The rotation angle can be positive and negative.
• For positive rotation angle, we can use the above
rotation matrix. However, for negative angle
rotation, the matrix will change as shown below −
• R= [cos(-Ɵ) sin(-Ɵ)]
[-sin(-Ɵ) cos(-Ɵ)]
• =[cosƟ -sinƟ]
[sinƟ cosƟ]
• (∵cos(−θ)=cosθ and sin(−θ)=−sinθ)
Scaling
• To change the size of an object, scaling transformation
is used.
• In the scaling process, you either expand or compress
the dimensions of the object.
• Scaling can be achieved by multiplying the original
coordinates of the object with the scaling factor to get
the desired result.
• Let us assume that the original coordinates are X,Y the
scaling factors are (SX, SY), and the produced
coordinates are X′,Y′SSSSS. This can be mathematically
represented as shown below −
• X' = X . SX and Y' = Y . SY
• The scaling factor SX, SY scales the object in X
and Y direction respectively. The above
equations can also be represented in matrix
form as below −
X’ = X [Sx 0]
Y’ Y [0 Sy]
• P’ = P . S
• Where S is the scaling matrix. The scaling
process is shown in the following figure.
BEFORE SCALING
AFTER SCALING
SCALING FACTOR
• If we provide values less than 1 to the scaling
factor S, then we can reduce the size of the
object. If we provide values greater than 1,
then we can increase the size of the object.
THANK YOU

More Related Content

Similar to moule 3 ppt1 basic 2D transformations.pptx

Computer Graphics - transformations in 2d
Computer Graphics - transformations in 2dComputer Graphics - transformations in 2d
Computer Graphics - transformations in 2d
Hisham Al Kurdi, EAVA, DMC-D-4K, HCCA-P, HCAA-D
 
Computer Graphic - Transformations in 2D
Computer Graphic - Transformations in 2DComputer Graphic - Transformations in 2D
Computer Graphic - Transformations in 2D
2013901097
 
Unit 3 notes
Unit 3 notesUnit 3 notes
Unit 3 notes
Balamurugan M
 
2 d geometric transformations
2 d geometric transformations2 d geometric transformations
2 d geometric transformationsMohd Arif
 
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
 
2D Transformation
2D Transformation2D Transformation
2D Transformation
ShahDhruv21
 
2-D Transformations.pdf
2-D Transformations.pdf2-D Transformations.pdf
2-D Transformations.pdf
Mattupallipardhu
 
06.Transformation.ppt
06.Transformation.ppt06.Transformation.ppt
06.Transformation.ppt
RobinAhmedSaikat
 
2D Transformation.pdf
2D Transformation.pdf2D Transformation.pdf
2D Transformation.pdf
maheshshinde762539
 
GeometricTransformations.ppt
GeometricTransformations.pptGeometricTransformations.ppt
GeometricTransformations.ppt
Debjit Doira
 
2D Transformation
2D Transformation2D Transformation
2D Transformation
Asma Tehseen
 
2 d transformation
2 d transformation2 d transformation
2 d transformation
Ankit Garg
 
Unit-3 overview of transformations
Unit-3 overview of transformationsUnit-3 overview of transformations
Unit-3 overview of transformations
Amol Gaikwad
 
3D transformation and viewing
3D transformation and viewing3D transformation and viewing
3D transformation and viewing
Yogita Jain
 
module 3 ppt2 (1).pptx
module 3 ppt2 (1).pptxmodule 3 ppt2 (1).pptx
module 3 ppt2 (1).pptx
RADHIKAB20
 
transformation IT.ppt
transformation IT.ppttransformation IT.ppt
transformation IT.ppt
ShubhamBatwani
 
2d-transformation
2d-transformation2d-transformation
2d-transformation
Pooja Dixit
 
3D Transformation
3D Transformation3D Transformation
3D Transformation
Ahammednayeem
 
2D Transformation
2D Transformation2D Transformation
2D Transformation
A. S. M. Shafi
 
Two dimensionaltransformations
Two dimensionaltransformationsTwo dimensionaltransformations
Two dimensionaltransformations
Nareek
 

Similar to moule 3 ppt1 basic 2D transformations.pptx (20)

Computer Graphics - transformations in 2d
Computer Graphics - transformations in 2dComputer Graphics - transformations in 2d
Computer Graphics - transformations in 2d
 
Computer Graphic - Transformations in 2D
Computer Graphic - Transformations in 2DComputer Graphic - Transformations in 2D
Computer Graphic - Transformations in 2D
 
Unit 3 notes
Unit 3 notesUnit 3 notes
Unit 3 notes
 
2 d geometric transformations
2 d geometric transformations2 d geometric transformations
2 d geometric transformations
 
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)
 
2D Transformation
2D Transformation2D Transformation
2D Transformation
 
2-D Transformations.pdf
2-D Transformations.pdf2-D Transformations.pdf
2-D Transformations.pdf
 
06.Transformation.ppt
06.Transformation.ppt06.Transformation.ppt
06.Transformation.ppt
 
2D Transformation.pdf
2D Transformation.pdf2D Transformation.pdf
2D Transformation.pdf
 
GeometricTransformations.ppt
GeometricTransformations.pptGeometricTransformations.ppt
GeometricTransformations.ppt
 
2D Transformation
2D Transformation2D Transformation
2D Transformation
 
2 d transformation
2 d transformation2 d transformation
2 d transformation
 
Unit-3 overview of transformations
Unit-3 overview of transformationsUnit-3 overview of transformations
Unit-3 overview of transformations
 
3D transformation and viewing
3D transformation and viewing3D transformation and viewing
3D transformation and viewing
 
module 3 ppt2 (1).pptx
module 3 ppt2 (1).pptxmodule 3 ppt2 (1).pptx
module 3 ppt2 (1).pptx
 
transformation IT.ppt
transformation IT.ppttransformation IT.ppt
transformation IT.ppt
 
2d-transformation
2d-transformation2d-transformation
2d-transformation
 
3D Transformation
3D Transformation3D Transformation
3D Transformation
 
2D Transformation
2D Transformation2D Transformation
2D Transformation
 
Two dimensionaltransformations
Two dimensionaltransformationsTwo dimensionaltransformations
Two dimensionaltransformations
 

Recently uploaded

aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
siemaillard
 
Welcome to TechSoup New Member Orientation and Q&A (May 2024).pdf
Welcome to TechSoup   New Member Orientation and Q&A (May 2024).pdfWelcome to TechSoup   New Member Orientation and Q&A (May 2024).pdf
Welcome to TechSoup New Member Orientation and Q&A (May 2024).pdf
TechSoup
 
Home assignment II on Spectroscopy 2024 Answers.pdf
Home assignment II on Spectroscopy 2024 Answers.pdfHome assignment II on Spectroscopy 2024 Answers.pdf
Home assignment II on Spectroscopy 2024 Answers.pdf
Tamralipta Mahavidyalaya
 
2024.06.01 Introducing a competency framework for languag learning materials ...
2024.06.01 Introducing a competency framework for languag learning materials ...2024.06.01 Introducing a competency framework for languag learning materials ...
2024.06.01 Introducing a competency framework for languag learning materials ...
Sandy Millin
 
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
MysoreMuleSoftMeetup
 
Overview on Edible Vaccine: Pros & Cons with Mechanism
Overview on Edible Vaccine: Pros & Cons with MechanismOverview on Edible Vaccine: Pros & Cons with Mechanism
Overview on Edible Vaccine: Pros & Cons with Mechanism
DeeptiGupta154
 
Sha'Carri Richardson Presentation 202345
Sha'Carri Richardson Presentation 202345Sha'Carri Richardson Presentation 202345
Sha'Carri Richardson Presentation 202345
beazzy04
 
Digital Tools and AI for Teaching Learning and Research
Digital Tools and AI for Teaching Learning and ResearchDigital Tools and AI for Teaching Learning and Research
Digital Tools and AI for Teaching Learning and Research
Vikramjit Singh
 
Embracing GenAI - A Strategic Imperative
Embracing GenAI - A Strategic ImperativeEmbracing GenAI - A Strategic Imperative
Embracing GenAI - A Strategic Imperative
Peter Windle
 
Biological Screening of Herbal Drugs in detailed.
Biological Screening of Herbal Drugs in detailed.Biological Screening of Herbal Drugs in detailed.
Biological Screening of Herbal Drugs in detailed.
Ashokrao Mane college of Pharmacy Peth-Vadgaon
 
BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...
BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...
BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...
Nguyen Thanh Tu Collection
 
Lapbook sobre os Regimes Totalitários.pdf
Lapbook sobre os Regimes Totalitários.pdfLapbook sobre os Regimes Totalitários.pdf
Lapbook sobre os Regimes Totalitários.pdf
Jean Carlos Nunes Paixão
 
The Accursed House by Émile Gaboriau.pptx
The Accursed House by Émile Gaboriau.pptxThe Accursed House by Émile Gaboriau.pptx
The Accursed House by Émile Gaboriau.pptx
DhatriParmar
 
The geography of Taylor Swift - some ideas
The geography of Taylor Swift - some ideasThe geography of Taylor Swift - some ideas
The geography of Taylor Swift - some ideas
GeoBlogs
 
Adversarial Attention Modeling for Multi-dimensional Emotion Regression.pdf
Adversarial Attention Modeling for Multi-dimensional Emotion Regression.pdfAdversarial Attention Modeling for Multi-dimensional Emotion Regression.pdf
Adversarial Attention Modeling for Multi-dimensional Emotion Regression.pdf
Po-Chuan Chen
 
How libraries can support authors with open access requirements for UKRI fund...
How libraries can support authors with open access requirements for UKRI fund...How libraries can support authors with open access requirements for UKRI fund...
How libraries can support authors with open access requirements for UKRI fund...
Jisc
 
"Protectable subject matters, Protection in biotechnology, Protection of othe...
"Protectable subject matters, Protection in biotechnology, Protection of othe..."Protectable subject matters, Protection in biotechnology, Protection of othe...
"Protectable subject matters, Protection in biotechnology, Protection of othe...
SACHIN R KONDAGURI
 
The French Revolution Class 9 Study Material pdf free download
The French Revolution Class 9 Study Material pdf free downloadThe French Revolution Class 9 Study Material pdf free download
The French Revolution Class 9 Study Material pdf free download
Vivekanand Anglo Vedic Academy
 
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXXPhrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
MIRIAMSALINAS13
 
Francesca Gottschalk - How can education support child empowerment.pptx
Francesca Gottschalk - How can education support child empowerment.pptxFrancesca Gottschalk - How can education support child empowerment.pptx
Francesca Gottschalk - How can education support child empowerment.pptx
EduSkills OECD
 

Recently uploaded (20)

aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
 
Welcome to TechSoup New Member Orientation and Q&A (May 2024).pdf
Welcome to TechSoup   New Member Orientation and Q&A (May 2024).pdfWelcome to TechSoup   New Member Orientation and Q&A (May 2024).pdf
Welcome to TechSoup New Member Orientation and Q&A (May 2024).pdf
 
Home assignment II on Spectroscopy 2024 Answers.pdf
Home assignment II on Spectroscopy 2024 Answers.pdfHome assignment II on Spectroscopy 2024 Answers.pdf
Home assignment II on Spectroscopy 2024 Answers.pdf
 
2024.06.01 Introducing a competency framework for languag learning materials ...
2024.06.01 Introducing a competency framework for languag learning materials ...2024.06.01 Introducing a competency framework for languag learning materials ...
2024.06.01 Introducing a competency framework for languag learning materials ...
 
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
 
Overview on Edible Vaccine: Pros & Cons with Mechanism
Overview on Edible Vaccine: Pros & Cons with MechanismOverview on Edible Vaccine: Pros & Cons with Mechanism
Overview on Edible Vaccine: Pros & Cons with Mechanism
 
Sha'Carri Richardson Presentation 202345
Sha'Carri Richardson Presentation 202345Sha'Carri Richardson Presentation 202345
Sha'Carri Richardson Presentation 202345
 
Digital Tools and AI for Teaching Learning and Research
Digital Tools and AI for Teaching Learning and ResearchDigital Tools and AI for Teaching Learning and Research
Digital Tools and AI for Teaching Learning and Research
 
Embracing GenAI - A Strategic Imperative
Embracing GenAI - A Strategic ImperativeEmbracing GenAI - A Strategic Imperative
Embracing GenAI - A Strategic Imperative
 
Biological Screening of Herbal Drugs in detailed.
Biological Screening of Herbal Drugs in detailed.Biological Screening of Herbal Drugs in detailed.
Biological Screening of Herbal Drugs in detailed.
 
BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...
BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...
BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...
 
Lapbook sobre os Regimes Totalitários.pdf
Lapbook sobre os Regimes Totalitários.pdfLapbook sobre os Regimes Totalitários.pdf
Lapbook sobre os Regimes Totalitários.pdf
 
The Accursed House by Émile Gaboriau.pptx
The Accursed House by Émile Gaboriau.pptxThe Accursed House by Émile Gaboriau.pptx
The Accursed House by Émile Gaboriau.pptx
 
The geography of Taylor Swift - some ideas
The geography of Taylor Swift - some ideasThe geography of Taylor Swift - some ideas
The geography of Taylor Swift - some ideas
 
Adversarial Attention Modeling for Multi-dimensional Emotion Regression.pdf
Adversarial Attention Modeling for Multi-dimensional Emotion Regression.pdfAdversarial Attention Modeling for Multi-dimensional Emotion Regression.pdf
Adversarial Attention Modeling for Multi-dimensional Emotion Regression.pdf
 
How libraries can support authors with open access requirements for UKRI fund...
How libraries can support authors with open access requirements for UKRI fund...How libraries can support authors with open access requirements for UKRI fund...
How libraries can support authors with open access requirements for UKRI fund...
 
"Protectable subject matters, Protection in biotechnology, Protection of othe...
"Protectable subject matters, Protection in biotechnology, Protection of othe..."Protectable subject matters, Protection in biotechnology, Protection of othe...
"Protectable subject matters, Protection in biotechnology, Protection of othe...
 
The French Revolution Class 9 Study Material pdf free download
The French Revolution Class 9 Study Material pdf free downloadThe French Revolution Class 9 Study Material pdf free download
The French Revolution Class 9 Study Material pdf free download
 
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXXPhrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
 
Francesca Gottschalk - How can education support child empowerment.pptx
Francesca Gottschalk - How can education support child empowerment.pptxFrancesca Gottschalk - How can education support child empowerment.pptx
Francesca Gottschalk - How can education support child empowerment.pptx
 

moule 3 ppt1 basic 2D transformations.pptx

  • 2. TRANSFORMATION • Transformation means changing some graphics into something else by applying rules. We can have various types of transformations such as translation, scaling up or down, rotation, shearing, etc. • When a transformation takes place on a 2D plane, it is called 2D transformation. • Transformations play an important role in computer graphics to reposition the graphics on the screen and change their size or orientation.
  • 3. Homogenous Coordinates • To perform a sequence of transformation such as translation followed by rotation and scaling, we need to follow a sequential process − • Translate the coordinates, • Rotate the translated coordinates, and then • Scale the rotated coordinates to complete the composite transformation.
  • 4. Translation • A translation moves an object to a different position on the screen. • You can translate a point in 2D by adding translation coordinate (tx, ty) to the original coordinate X, Y to get the new coordinate X′, Y′.
  • 5.
  • 6. • From the above figure, you can write that − • X’ = X + tx • Y’ = Y + ty • The pair (tx, ty) is called the translation vector or shift vector. The above equations can also be represented using the column vectors. • P=[X] / [Y] • p' = [X′] / [Y′] • T = [tx] / [ty] • We can write it as − • P’ = P + T
  • 7. Rotation • In rotation, we rotate the object at particular angle θ theta from its origin. • From the following figure, we can see that the point PX,Y is located at angle φ from the horizontal X coordinate with distance r from the origin. • Let us suppose you want to rotate it at the angle θ. After rotating it to a new location, you will get a new point P’ X′,Y′.
  • 8.
  • 9. • Using standard trigonometric the original coordinate of point P X,Y can be represented as − • X=r cosϕ ......(1) • Y=r sinϕ ......(2) • Same way we can represent the point P’ X′, Y′ as − • x′=rcos(ϕ+θ) = rcosϕcosθ − rsinϕsinθ.......(3) • y′=rsin(ϕ+θ) = rcosϕsinθ + rsinϕcosθ.......(4) Substituting equation 1 & 2 in 3 & 4 respectively, we will get
  • 10. x′=xcosθ−ysinθ y′=xsinθ+ycosθ • Representing the above equation in matrix form, • [X′Y′]=[XY] [cosƟ sinƟ] [-sinƟ cosƟ] OR • P’ = P . R • Where R is the rotation matrix • R= [cosƟ sinƟ] [-sinƟ cosƟ]
  • 11. • The rotation angle can be positive and negative. • For positive rotation angle, we can use the above rotation matrix. However, for negative angle rotation, the matrix will change as shown below − • R= [cos(-Ɵ) sin(-Ɵ)] [-sin(-Ɵ) cos(-Ɵ)] • =[cosƟ -sinƟ] [sinƟ cosƟ] • (∵cos(−θ)=cosθ and sin(−θ)=−sinθ)
  • 12. Scaling • To change the size of an object, scaling transformation is used. • In the scaling process, you either expand or compress the dimensions of the object. • Scaling can be achieved by multiplying the original coordinates of the object with the scaling factor to get the desired result. • Let us assume that the original coordinates are X,Y the scaling factors are (SX, SY), and the produced coordinates are X′,Y′SSSSS. This can be mathematically represented as shown below − • X' = X . SX and Y' = Y . SY
  • 13. • The scaling factor SX, SY scales the object in X and Y direction respectively. The above equations can also be represented in matrix form as below − X’ = X [Sx 0] Y’ Y [0 Sy] • P’ = P . S • Where S is the scaling matrix. The scaling process is shown in the following figure.
  • 16. SCALING FACTOR • If we provide values less than 1 to the scaling factor S, then we can reduce the size of the object. If we provide values greater than 1, then we can increase the size of the object.