SlideShare ist ein Scribd-Unternehmen logo
1 von 4
Downloaden Sie, um offline zu lesen
Computer Graphics
2D Transformations
A transformation is any operation on a point in space (x, y) that maps the point's coordinates into a new set
of coordinates (x1,y1).

Translation
In translation an object is displaced a given distance and direction from its original position. If the
displacement is given by the vector v = txI + tyJ, the new object point P'(x', y') can be found by applying
the transformation Tv to P(x, y). See the figure below

                                                   P' = Tv(P)

where x' = x + tx and y' = y + ty.

As an example, consider a triangle defined by three vertices (20,0), (60, 0), and (40, 100) being translated
100 units to the right along the x-axis ( tx = 100) and 10 units up along the y-axis (ty = 10). The new
vertices are (120, 10), (160, 10), and (140, 110), see figure below:




Rotation
In rotation, the object is rotated ø° about the origin. The convention is that the direction of the rotation is
CCW if ø is a positive angle and CW if the ø is a negative angle. The transformation for rotation Rø is

                                                   P' = Rø(P)

                          where x' = x cos(ø) - y sin(ø) and y' = x sin(ø) + y cos(ø)




 For example a triangle (20,0), (60,0), (40,100) rotated 45° clockwise about the origin is (14.14, -14.14),
                                      (42.43, -42.43), (98.99, -42.43)

K. Adisesha                                                                                                       1
Computer Graphics



Scaling
Scaling is the process of expanding or compressing the dimensions of an object. Positive scaling
constants Sx and Sy are used to describe changes in length with respect to the x direction and y direction. A
scaling constant > 1 creates an expansion (magnification) of length, and < 1 a compression (reduction) of
length. Scaling occurs along the x-axis and y-axis to create a new point from the original. This is achieved
using the following transformation:

                                                P' = TSx,Sy (P),

where x' = Sx * x ,and y' = Sy * y

If Sx and Sy are not equal, they have the effect of distorting pictures by elongating or shrinking them along
the directions parallel to the coordinate axes. The mirror image of an object can be generated by using the
negative values for Sxand Sy.

Homogeneous Coordinates
Translation, scaling and rotation were expressed non-homogenously:
P´ = P + T
P´ = S × P
P´ = R × P

Composition is difficult to express using the standard notation above. Homogeneous coordinates allow all
three to be expressed homogeneously, using multiplication by 3 × 3 matrices.
Add a third coordinate to a point P(x,y). So instead of representing the point using an (x,y) coordinate
pair, each point is represented by three values, (x, y, W).

P2d (x, y) -> Ph (wx, wy, w), w xb9 0

Given Ph (x, y, w), w xb9 0

Then P2d (x, y) = P2d (x/w, y/w)

W is 1 for affine transformations in graphics. Affine transformations have the property of preserving
parallism of lines, but not the lengths and angles. See example in figure 5.6 on page 207 in your Computer
Graphics text.

Shear an affine transformation
A shear is a transformation that distorts the shape of an object along either or both of the axies. Like scale
and translate, a shear can be done along just one or along both of the coordinate axes. A shear along one
axis (say, the x-axis) is performed in terms of the point's coordinate in the other axis (the y-axis). Thus a
shear of 1 in the x-axis will cause the x-coodinate of the point ot distort by 1*(y-coordinate).


K. Adisesha                                                                                                  2
Computer Graphics
To shear in the x direction the equation is:
x1 = x + ay
y1 = y

Where b = 0

Where x1 and y1 are the new values, x and y are the original values, and a is the scaling factor in the x
direction. The matrix is as follows.




Shearing in the y direction is similar except the roles are reversed.

x1 = x
y1 = y + bx

Where a = 0.

Where x1 and y1 are the new values, x and y are the original values, and b is the scaling factor in
the y direction. The matrix is as follows.




                                                 Example




Original Y-Shear X-Shear



K. Adisesha                                                                                                 3
Computer Graphics
Composition
R(ø) rotates about the origin; to rotate about P1

       Translate P1 to origin
       Rotate

Translate origin back to P1




K. Adisesha                                         4

Weitere ähnliche Inhalte

Was ist angesagt?

Coordinate transformation
Coordinate transformationCoordinate transformation
Coordinate transformation
Mohd Arif
 
2 d transformations and homogeneous coordinates
2 d transformations and homogeneous coordinates2 d transformations and homogeneous coordinates
2 d transformations and homogeneous coordinates
Tarun Gehlot
 

Was ist angesagt? (19)

CG 2D Transformation
CG 2D TransformationCG 2D Transformation
CG 2D Transformation
 
2D Transformation
2D Transformation2D Transformation
2D Transformation
 
Overview of 2D and 3D Transformation
Overview of 2D and 3D TransformationOverview of 2D and 3D Transformation
Overview of 2D and 3D Transformation
 
2D Transformation
2D Transformation2D Transformation
2D Transformation
 
seminar on 2D transformation
seminar on 2D transformationseminar on 2D transformation
seminar on 2D transformation
 
Lect6 transformation2d
Lect6 transformation2dLect6 transformation2d
Lect6 transformation2d
 
3 d transformation
3 d transformation3 d transformation
3 d transformation
 
Transformations computer graphics
Transformations computer graphics Transformations computer graphics
Transformations computer graphics
 
Coordinate transformation
Coordinate transformationCoordinate transformation
Coordinate transformation
 
Transforms UNIt 2
Transforms UNIt 2 Transforms UNIt 2
Transforms UNIt 2
 
Computer graphics basic transformation
Computer graphics basic transformationComputer graphics basic transformation
Computer graphics basic transformation
 
2d transformations
2d transformations2d transformations
2d transformations
 
Computer Graphic - Transformations in 2D
Computer Graphic - Transformations in 2DComputer Graphic - Transformations in 2D
Computer Graphic - Transformations in 2D
 
2 d transformations and homogeneous coordinates
2 d transformations and homogeneous coordinates2 d transformations and homogeneous coordinates
2 d transformations and homogeneous coordinates
 
Homogeneous Representation: rotating, shearing
Homogeneous Representation: rotating, shearingHomogeneous Representation: rotating, shearing
Homogeneous Representation: rotating, shearing
 
2d transformation
2d transformation2d transformation
2d transformation
 
3 d scaling and translation in homogeneous coordinates
3 d scaling and translation in homogeneous coordinates3 d scaling and translation in homogeneous coordinates
3 d scaling and translation in homogeneous coordinates
 
Modeling Transformations
Modeling TransformationsModeling Transformations
Modeling Transformations
 
2 d transformations
2 d transformations2 d transformations
2 d transformations
 

Andere mochten auch

Hearn and Baker 2 D transformations
Hearn and Baker 2 D transformations   Hearn and Baker 2 D transformations
Hearn and Baker 2 D transformations
Taher Barodawala
 

Andere mochten auch (13)

Computer basics
Computer basicsComputer basics
Computer basics
 
MS Excel 2010 tutorial 6
MS Excel 2010 tutorial 6MS Excel 2010 tutorial 6
MS Excel 2010 tutorial 6
 
Computer graphics
Computer graphics   Computer graphics
Computer graphics
 
Computer Graphics
Computer GraphicsComputer Graphics
Computer Graphics
 
Computer basic theory
Computer basic theoryComputer basic theory
Computer basic theory
 
Computer fundamentals-series1-e book
Computer fundamentals-series1-e bookComputer fundamentals-series1-e book
Computer fundamentals-series1-e book
 
Computer fundamental full
Computer fundamental fullComputer fundamental full
Computer fundamental full
 
Hearn and Baker 2 D transformations
Hearn and Baker 2 D transformations   Hearn and Baker 2 D transformations
Hearn and Baker 2 D transformations
 
Notes 2D-Transformation Unit 2 Computer graphics
Notes 2D-Transformation Unit 2 Computer graphicsNotes 2D-Transformation Unit 2 Computer graphics
Notes 2D-Transformation Unit 2 Computer graphics
 
Projection In Computer Graphics
Projection In Computer GraphicsProjection In Computer Graphics
Projection In Computer Graphics
 
Projection
ProjectionProjection
Projection
 
BE sem 1 Engineering Graphics(E.G.) full course ppt
BE sem 1 Engineering Graphics(E.G.) full course pptBE sem 1 Engineering Graphics(E.G.) full course ppt
BE sem 1 Engineering Graphics(E.G.) full course ppt
 
Engineering Drawing
Engineering DrawingEngineering Drawing
Engineering Drawing
 

Ähnlich wie 2 d transformations

2 d geometric transformations
2 d geometric transformations2 d geometric transformations
2 d geometric transformations
Mohd Arif
 
2 d transformation
2 d transformation2 d transformation
2 d transformation
Ankit Garg
 
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
 

Ähnlich wie 2 d transformations (20)

2D-transformation-1.pdf
2D-transformation-1.pdf2D-transformation-1.pdf
2D-transformation-1.pdf
 
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)
 
2 d transformation
2 d transformation2 d transformation
2 d transformation
 
Unit 3 notes
Unit 3 notesUnit 3 notes
Unit 3 notes
 
3D transformation in computer graphics
3D transformation in computer graphics3D transformation in computer graphics
3D transformation in computer graphics
 
Two dimentional transform
Two dimentional transformTwo dimentional transform
Two dimentional transform
 
2Dand3D transformationppt.pptx
2Dand3D transformationppt.pptx2Dand3D transformationppt.pptx
2Dand3D transformationppt.pptx
 
06.Transformation.ppt
06.Transformation.ppt06.Transformation.ppt
06.Transformation.ppt
 
Computer Graphics - transformations in 2d
Computer Graphics - transformations in 2dComputer Graphics - transformations in 2d
Computer Graphics - transformations in 2d
 
Beginning direct3d gameprogrammingmath06_transformations_20161019_jintaeks
Beginning direct3d gameprogrammingmath06_transformations_20161019_jintaeksBeginning direct3d gameprogrammingmath06_transformations_20161019_jintaeks
Beginning direct3d gameprogrammingmath06_transformations_20161019_jintaeks
 
SinogramReconstruction
SinogramReconstructionSinogramReconstruction
SinogramReconstruction
 
2D transformations
2D transformations2D transformations
2D transformations
 
Computer Graphics & linear Algebra
Computer Graphics & linear Algebra Computer Graphics & linear Algebra
Computer Graphics & linear Algebra
 
Mathematics.pdf
Mathematics.pdfMathematics.pdf
Mathematics.pdf
 
2-D Transformations.pdf
2-D Transformations.pdf2-D Transformations.pdf
2-D Transformations.pdf
 
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
 
Notes 3-4
Notes 3-4Notes 3-4
Notes 3-4
 
1533 game mathematics
1533 game mathematics1533 game mathematics
1533 game mathematics
 
Two dimensional geometric transformation
Two dimensional geometric transformationTwo dimensional geometric transformation
Two dimensional geometric transformation
 

Mehr von Prof. Dr. K. Adisesha

Mehr von Prof. Dr. K. Adisesha (20)

Software Engineering notes by K. Adisesha.pdf
Software Engineering notes by K. Adisesha.pdfSoftware Engineering notes by K. Adisesha.pdf
Software Engineering notes by K. Adisesha.pdf
 
Software Engineering-Unit 1 by Adisesha.pdf
Software Engineering-Unit 1 by Adisesha.pdfSoftware Engineering-Unit 1 by Adisesha.pdf
Software Engineering-Unit 1 by Adisesha.pdf
 
Software Engineering-Unit 2 "Requirement Engineering" by Adi.pdf
Software Engineering-Unit 2 "Requirement Engineering" by Adi.pdfSoftware Engineering-Unit 2 "Requirement Engineering" by Adi.pdf
Software Engineering-Unit 2 "Requirement Engineering" by Adi.pdf
 
Software Engineering-Unit 3 "System Modelling" by Adi.pdf
Software Engineering-Unit 3 "System Modelling" by Adi.pdfSoftware Engineering-Unit 3 "System Modelling" by Adi.pdf
Software Engineering-Unit 3 "System Modelling" by Adi.pdf
 
Software Engineering-Unit 4 "Architectural Design" by Adi.pdf
Software Engineering-Unit 4 "Architectural Design" by Adi.pdfSoftware Engineering-Unit 4 "Architectural Design" by Adi.pdf
Software Engineering-Unit 4 "Architectural Design" by Adi.pdf
 
Software Engineering-Unit 5 "Software Testing"by Adi.pdf
Software Engineering-Unit 5 "Software Testing"by Adi.pdfSoftware Engineering-Unit 5 "Software Testing"by Adi.pdf
Software Engineering-Unit 5 "Software Testing"by Adi.pdf
 
Computer Networks Notes by -Dr. K. Adisesha
Computer Networks Notes by -Dr. K. AdiseshaComputer Networks Notes by -Dr. K. Adisesha
Computer Networks Notes by -Dr. K. Adisesha
 
CCN Unit-1&2 Data Communication &Networking by K. Adiaesha
CCN Unit-1&2 Data Communication &Networking by K. AdiaeshaCCN Unit-1&2 Data Communication &Networking by K. Adiaesha
CCN Unit-1&2 Data Communication &Networking by K. Adiaesha
 
CCN Unit-3 Data Link Layer by Dr. K. Adisesha
CCN Unit-3 Data Link Layer by Dr. K. AdiseshaCCN Unit-3 Data Link Layer by Dr. K. Adisesha
CCN Unit-3 Data Link Layer by Dr. K. Adisesha
 
CCN Unit-4 Network Layer by Dr. K. Adisesha
CCN Unit-4 Network Layer by Dr. K. AdiseshaCCN Unit-4 Network Layer by Dr. K. Adisesha
CCN Unit-4 Network Layer by Dr. K. Adisesha
 
CCN Unit-5 Transport & Application Layer by Adi.pdf
CCN Unit-5 Transport & Application Layer by Adi.pdfCCN Unit-5 Transport & Application Layer by Adi.pdf
CCN Unit-5 Transport & Application Layer by Adi.pdf
 
Introduction to Computers.pdf
Introduction to Computers.pdfIntroduction to Computers.pdf
Introduction to Computers.pdf
 
R_Programming.pdf
R_Programming.pdfR_Programming.pdf
R_Programming.pdf
 
Scholarship.pdf
Scholarship.pdfScholarship.pdf
Scholarship.pdf
 
Operating System-2 by Adi.pdf
Operating System-2 by Adi.pdfOperating System-2 by Adi.pdf
Operating System-2 by Adi.pdf
 
Operating System-1 by Adi.pdf
Operating System-1 by Adi.pdfOperating System-1 by Adi.pdf
Operating System-1 by Adi.pdf
 
Operating System-adi.pdf
Operating System-adi.pdfOperating System-adi.pdf
Operating System-adi.pdf
 
Data_structure using C-Adi.pdf
Data_structure using C-Adi.pdfData_structure using C-Adi.pdf
Data_structure using C-Adi.pdf
 
JAVA PPT -2 BY ADI.pdf
JAVA PPT -2 BY ADI.pdfJAVA PPT -2 BY ADI.pdf
JAVA PPT -2 BY ADI.pdf
 
JAVA PPT -5 BY ADI.pdf
JAVA PPT -5 BY ADI.pdfJAVA PPT -5 BY ADI.pdf
JAVA PPT -5 BY ADI.pdf
 

Kürzlich hochgeladen

Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
WSO2
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
panagenda
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Victor Rentea
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 

Kürzlich hochgeladen (20)

Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
 
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
 
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot ModelMcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusExploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with Milvus
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challenges
 
Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​
 
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
 
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 

2 d transformations

  • 1. Computer Graphics 2D Transformations A transformation is any operation on a point in space (x, y) that maps the point's coordinates into a new set of coordinates (x1,y1). Translation In translation an object is displaced a given distance and direction from its original position. If the displacement is given by the vector v = txI + tyJ, the new object point P'(x', y') can be found by applying the transformation Tv to P(x, y). See the figure below P' = Tv(P) where x' = x + tx and y' = y + ty. As an example, consider a triangle defined by three vertices (20,0), (60, 0), and (40, 100) being translated 100 units to the right along the x-axis ( tx = 100) and 10 units up along the y-axis (ty = 10). The new vertices are (120, 10), (160, 10), and (140, 110), see figure below: Rotation In rotation, the object is rotated ø° about the origin. The convention is that the direction of the rotation is CCW if ø is a positive angle and CW if the ø is a negative angle. The transformation for rotation Rø is P' = Rø(P) where x' = x cos(ø) - y sin(ø) and y' = x sin(ø) + y cos(ø) For example a triangle (20,0), (60,0), (40,100) rotated 45° clockwise about the origin is (14.14, -14.14), (42.43, -42.43), (98.99, -42.43) K. Adisesha 1
  • 2. Computer Graphics Scaling Scaling is the process of expanding or compressing the dimensions of an object. Positive scaling constants Sx and Sy are used to describe changes in length with respect to the x direction and y direction. A scaling constant > 1 creates an expansion (magnification) of length, and < 1 a compression (reduction) of length. Scaling occurs along the x-axis and y-axis to create a new point from the original. This is achieved using the following transformation: P' = TSx,Sy (P), where x' = Sx * x ,and y' = Sy * y If Sx and Sy are not equal, they have the effect of distorting pictures by elongating or shrinking them along the directions parallel to the coordinate axes. The mirror image of an object can be generated by using the negative values for Sxand Sy. Homogeneous Coordinates Translation, scaling and rotation were expressed non-homogenously: P´ = P + T P´ = S × P P´ = R × P Composition is difficult to express using the standard notation above. Homogeneous coordinates allow all three to be expressed homogeneously, using multiplication by 3 × 3 matrices. Add a third coordinate to a point P(x,y). So instead of representing the point using an (x,y) coordinate pair, each point is represented by three values, (x, y, W). P2d (x, y) -> Ph (wx, wy, w), w xb9 0 Given Ph (x, y, w), w xb9 0 Then P2d (x, y) = P2d (x/w, y/w) W is 1 for affine transformations in graphics. Affine transformations have the property of preserving parallism of lines, but not the lengths and angles. See example in figure 5.6 on page 207 in your Computer Graphics text. Shear an affine transformation A shear is a transformation that distorts the shape of an object along either or both of the axies. Like scale and translate, a shear can be done along just one or along both of the coordinate axes. A shear along one axis (say, the x-axis) is performed in terms of the point's coordinate in the other axis (the y-axis). Thus a shear of 1 in the x-axis will cause the x-coodinate of the point ot distort by 1*(y-coordinate). K. Adisesha 2
  • 3. Computer Graphics To shear in the x direction the equation is: x1 = x + ay y1 = y Where b = 0 Where x1 and y1 are the new values, x and y are the original values, and a is the scaling factor in the x direction. The matrix is as follows. Shearing in the y direction is similar except the roles are reversed. x1 = x y1 = y + bx Where a = 0. Where x1 and y1 are the new values, x and y are the original values, and b is the scaling factor in the y direction. The matrix is as follows. Example Original Y-Shear X-Shear K. Adisesha 3
  • 4. Computer Graphics Composition R(ø) rotates about the origin; to rotate about P1 Translate P1 to origin Rotate Translate origin back to P1 K. Adisesha 4