SlideShare une entreprise Scribd logo
1  sur  4
Télécharger pour lire hors ligne
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

Contenu connexe

Tendances

CG 2D Transformation
CG 2D TransformationCG 2D Transformation
CG 2D TransformationMohitModyani
 
Overview of 2D and 3D Transformation
Overview of 2D and 3D TransformationOverview of 2D and 3D Transformation
Overview of 2D and 3D TransformationDheeraj Sadawarte
 
2D Transformation
2D Transformation2D Transformation
2D TransformationShahDhruv21
 
seminar on 2D transformation
seminar on 2D transformationseminar on 2D transformation
seminar on 2D transformation9784
 
Lect6 transformation2d
Lect6 transformation2dLect6 transformation2d
Lect6 transformation2dBCET
 
3 d transformation
3 d transformation3 d transformation
3 d transformationPooja Dixit
 
Transformations computer graphics
Transformations computer graphics Transformations computer graphics
Transformations computer graphics Vikram Halder
 
Coordinate transformation
Coordinate transformationCoordinate transformation
Coordinate transformationMohd Arif
 
Computer graphics basic transformation
Computer graphics basic transformationComputer graphics basic transformation
Computer graphics basic transformationSelvakumar Gna
 
2d transformations
2d transformations2d transformations
2d transformationskmrvivek2
 
Computer Graphic - Transformations in 2D
Computer Graphic - Transformations in 2DComputer Graphic - Transformations in 2D
Computer Graphic - Transformations in 2D2013901097
 
2 d transformations and homogeneous coordinates
2 d transformations and homogeneous coordinates2 d transformations and homogeneous coordinates
2 d transformations and homogeneous coordinatesTarun Gehlot
 
Homogeneous Representation: rotating, shearing
Homogeneous Representation: rotating, shearingHomogeneous Representation: rotating, shearing
Homogeneous Representation: rotating, shearingManthan Kanani
 
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 coordinatesKRIPA SHNAKAR TIWARI
 
Modeling Transformations
Modeling TransformationsModeling Transformations
Modeling TransformationsTarun Gehlot
 
2 d transformations
2 d transformations2 d transformations
2 d transformationsSardar Alam
 

Tendances (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
 

En vedette (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
 

Similaire à 2 d transformations

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
 
2 d transformation
2 d transformation2 d transformation
2 d transformationAnkit Garg
 
3D transformation in computer graphics
3D transformation in computer graphics3D transformation in computer graphics
3D transformation in computer graphicsSHIVANI SONI
 
Two dimentional transform
Two dimentional transformTwo dimentional transform
Two dimentional transformPatel Punit
 
2Dand3D transformationppt.pptx
2Dand3D transformationppt.pptx2Dand3D transformationppt.pptx
2Dand3D transformationppt.pptxRAMESHCHANDRANE
 
Beginning direct3d gameprogrammingmath06_transformations_20161019_jintaeks
Beginning direct3d gameprogrammingmath06_transformations_20161019_jintaeksBeginning direct3d gameprogrammingmath06_transformations_20161019_jintaeks
Beginning direct3d gameprogrammingmath06_transformations_20161019_jintaeksJinTaek Seo
 
Computer Graphics & linear Algebra
Computer Graphics & linear Algebra Computer Graphics & linear Algebra
Computer Graphics & linear Algebra Xad Kuain
 
Mathematics.pdf
Mathematics.pdfMathematics.pdf
Mathematics.pdfzaraa30
 
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 .pptkdemersal
 
Two dimensional geometric transformation
Two dimensional geometric transformationTwo dimensional geometric transformation
Two dimensional geometric transformationjapan vasani
 

Similaire à 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
 

Plus de Prof. Dr. K. Adisesha

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.pdfProf. Dr. K. Adisesha
 
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.pdfProf. Dr. K. Adisesha
 
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.pdfProf. Dr. K. Adisesha
 
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.pdfProf. Dr. K. Adisesha
 
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.pdfProf. Dr. K. Adisesha
 
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.pdfProf. Dr. K. Adisesha
 
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. AdiseshaProf. 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. AdiaeshaProf. Dr. K. Adisesha
 
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. AdiseshaProf. 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. AdiseshaProf. 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.pdfProf. Dr. K. Adisesha
 

Plus de 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
 

Dernier

TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc
 
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...Principled Technologies
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherRemote DBA Services
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUK Journal
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processorsdebabhi2
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoffsammart93
 
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 DiscoveryTrustArc
 
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsTop 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsRoshan Dwivedi
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CVKhem
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdflior mazor
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...apidays
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?Igalia
 
Top 10 Most Downloaded Games on Play Store in 2024
Top 10 Most Downloaded Games on Play Store in 2024Top 10 Most Downloaded Games on Play Store in 2024
Top 10 Most Downloaded Games on Play Store in 2024SynarionITSolutions
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
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...apidays
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century educationjfdjdjcjdnsjd
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MIND CTI
 

Dernier (20)

TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
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
 
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsTop 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
Top 10 Most Downloaded Games on Play Store in 2024
Top 10 Most Downloaded Games on Play Store in 2024Top 10 Most Downloaded Games on Play Store in 2024
Top 10 Most Downloaded Games on Play Store in 2024
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
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...
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 

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