SlideShare a Scribd company logo
Presented By
Aditi Patni
Bachelors of Computer Application-Second Year
Dezyne E’Cole College, Ajmer
COMPUTER GRAPHICS
Project report on
2-D Transformations
Submitted To
Dezyne E’Cole College
Towards
The Partial Fulfilment
Of 2019 Year, Bachelor of Computer Application
By
Aditi Patni
Dezyne E’Cole College
106/10, Civil Line, Ajmer
www.dezyneecole.com
Acknowledgement
I Am Aditi Patni, student of Bachelor of Computer Application,
Dezyne E’Cole College. I would like to express my gratitude to
each and every person who has contributed in encouraging me
and helping me to coordinate my project.
I also thank Dezyne E’Cole College who provided insight and
expertise that greatly assisted the project. A special thanks to my
teachers, parents and colleagues who have supported me at every
step. Not to forget, the Almighty who blessed me with good
health because of which I worked more efficiently and better.
CONTENTS
 What is 2-D Transformations?
 Basic Transformations
 Translation
 Rotation
 Scaling
 Derived Transformations
 Reflection
 Shearing
2-D TRANSFORMATIONS
 Changes in the orientation, shape, size or position of an object,
such that the coordinate values of the object changes, is known
as 2-D Transformation.
 There are two types of transformations:
o Basic Transformation
o Derived Transformation
 The three basic transformations are:
o Translation
o Rotation
o Scaling
 From these three basic transformations two more transformation
has been derived. They are known as Derived Transformation.
 The derived transformation are:
o Reflection
o Shearing
Basic Transformations:
Translation:
 Translation can be defined as repositioning an object on a
straight path from one coordinate location to another coordinate
location.
 Translation is always considered on a straight path.
 The total distance by which an object is translated is known as
translation distance.
 There are two methods to perform translation:
1. Classic Method:
X’=X+Tx
Y’=Y+Ty
Tx= Translation in x direction
Ty= Translation in y direction
2. Modern Method:
Q’= T*Q
Q’= New Coordinates
T= Translation Distance
Q= Original Coordinates
1 0 Tx
0 1 Ty
0 0 1
Example:
Tx=3, Ty=3
Y
X’ 0 1 2 3 4 5 6 7 8 X
Y’
By Classic Method:
A: X’= 2+3= 5
Y’= 1+3= 4 (5, 4)
B: X’= 4+3= 7
Y’= 1+3= 4 (7, 4)
C: X’= 3+3= 6
Y’= 3+3= 6 (6, 6)
1
5
4
3
2
6
8
7
By Modern Method:
Q’= T*Q
Q’= 1 0 Tx 2 4 3
0 1 Ty 1 1 3
0 0 1 1 1 1
Q’= 1 0 3 2 4 3
0 1 3 1 1 3
0 0 1 1 1 1
Q’= 2+0+3 4+0+3 3+0+3
0+1+3 0+1+3 0+3+3
0+0+1 0+0+1 0+0+1
Q’= 5 7 6
4 4 6 (Answer)
1 1 1
Rotation:
 Rotation can be defined as repositioning an object on a circular
path from one angle to another.
 The fixed point is called the pivot point.
 We can rotate an object with five different angles and there is a
table with all these values:
Angle 0 degree 30 degree 45 degree 60 degree 90 degree
Sin 0 0.5 0.70 0.87 1
Cos 1 0.87 0.70 0.5 0
 The predefined matrix of rotation is:
Cos -Sin 0
Sin Cos 0
0 0 1
Example:
Rotation at 90 degree.
P’= R*P
P’= New Coordinates
R= Rotational Matrix
P= Original Coordinates
Y
5
4
3
2
1
X’ -4 -3 -2 -1 0 1 2 3 4 X
Y’
P’= Cos -Sin 0 1 4 1 4
Sin Cos 0 1 1 4 4
0 0 1 1 1 1 1
P’= 0 -1 0 1 4 1 4
1 0 0 1 1 4 4
0 0 1 1 1 1 1
P’= 0-1+0 0-1+0 0-4+0 0-4+0
1+0+0 4+0+0 1+0+0 4+0+0
0+0+1 0+0+1 0+0+1 0+0+1
P’= -1 -4 -1 -4
1 4 1 4 (Answer)
1 1 1 1
Scaling:
 A scaling transformation changes the size of an object. The size
may increase or decrease depending on the coordinate values.
 Sx and Sy are scaling factors.
 There are two methods to perform scaling:
1. Classic Method:
X’= X*Sx
Y’= Y*Sy
Sx= Scaling in X direction
Sy= Scaling in Y direction
2. Modern Method:
P’= S*P
P’= New Coordinates
S= Scaling Matrix
P= Original Coordinates
Sx 0 0
0 Sy 0
0 0 1
Example:
Sx=2, Sy=2
Y
X’ 0 1 2 3 4 5 6 7 8 X
Y’
1. Classic Method:
A: 2*2=4
1*2=2 (4, 2)
1
5
4
3
2
6
8
7
B: 4*2=8
1*2=2 (8, 2)
C: 3*2=6
3*2=6 (6, 6)
2. Modern Method:
P’= S*P
P’= Sx 0 0 2 4 3
0 Sy 0 1 1 3
0 0 1 1 1 1
P’= 2 0 0 2 4 3
0 2 0 1 1 3
0 0 1 1 1 1
P’= 4+0+0 8+0+0 6+0+0
0+2+0 0+2+0 0+6+0
0+0+1 0+0+1 0+0+1
P’= 4 8 6
2 2 6 (Answer)
1 1 1
Derived Transformations:
Reflection:
 In reflection we get the mirror image of an object.
 In this transformation, the size or shape of the object do not
change.
 To perform reflection we need a fixed line known as Reflection
Axis.
 As reflection has been derived from translation and rotation
therefore, it is known as derived transformation.
 There are four types of reflection:
o Reflection about x axis
o Reflection about Y axis
o Reflection when the reflection axis passes through
origin
o Reflection with respect to a diagonal line.
1. Reflection about X axis:
 In this the object is reflected with respect to X axis.
 The value of X remains same whereas the value of Y
becomes negative.
 The predefined matrix is:
1 0 0
0 -1 0
0 0 1
P’=R*P
P’= New Coordinates
R= Reflection Matrix
P= Original Coordinates
Example:
Y
5
4
3
2
1
X’ 0 1 2 3 4 5 6 X
-1
-2
-3
-4
-5
Y’
P’= 1 0 0 2 6 4
0 -1 0 1 1 4
0 0 1 1 1 1
P’= 2+0+0 6+0+0 4+0+0
0-1+0 0-1+0 0-4+0
0+0+1 0+0+1 0+0+1
P’= 2 6 4
-1 -1 -4 (Answer)
1 1 1
2. Reflection about Y axis:
 In this the object is reflected with respect of Y axis.
 The value of X becomes negative whereas the value of Y
remains same.
 The predefined matrix is:
-1 0 0
0 1 0
0 0 1
Example:
P’=S*P
P’= -1 0 0 2 6 4
0 1 0 1 1 4
0 0 1 1 1 1
P’= -2+0+0 -6+0+0 -4+0+0
0+1+0 0+1+0 0+4+0
0+0+1 0+0+1 0+0+1
P’= -2 -6 -4
1 1 4 (Answer)
1 1 1
Y
5
4
3
2
1
X’ -6 -5 -4 -3 -2 -1 0 1 2 3 4 5 6 X
Y’
3. Reflection when the reflection axis passes through the origin:
 In this, the object is rotated around the reflection axis by 180*.
 The value of both X and Y coordinates becomes negative.
 The predefined matrix is:
-1 0 0
0 -1 0
0 0 1
P’=R*P
P’= New Coordinates
R= Reflection Matrix
P= Original Coordinates
Example:
Y
5
4
3
2
1
X’ -5 -4 -3 -2 -1 0 1 2 3 4 5 X
-1
-2
-3
-4
-5
Y’
P’=R*P
P’= -1 0 0 1 5 3
0 -1 0 1 1 4
0 0 1 1 1 1
P’= -1+0+0 -5+0+0 -3+0+0
0-1+0 0-1+0 0-4+0
0+0+1 0+0+1 0+0+1
P’= -1 -5 -3
-1 -1 -4
1 1 1
4. Reflection with respect to a diagonal line:
 In this, the reflection axis and the object are rotated by 45* such
that the reflection axis coincides with X axis.
 The values of X and y coordinates gets interchanged.
 The predefined matrix is:
0 1 0
1 0 0
0 0 1
P’=R*P
P’= New Coordinates
R= Reflection Matrix
P= Original Coordinates
Example:
Y
5
4
3
2
1
X’ 0 1 2 3 4 5 6 X
Y’
P’= R*P
P’= 0 1 0 3 5 4
1 0 0 1 1 3
0 0 1 1 1 1
P’= 0+1+0 0+1+0 0+3+0
3+0+0 5+0+0 4+0+0
0+0+1 0+0+1 0+0+1
P’= 1 1 3
3 5 4 (Answer)
1 1 1
Shearing:
 Shearing is a transformation in which the shape of the object
changes. During shearing we assume that object is made up of
many layers. In shearing the top layer is shifted and the bottom
layer remains fixed.
 There are two types of shearing:
o Shearing in X direction
o Shearing in Y direction
1. Shearing in X direction:
 In such shearing the coordinates of the object are shifted
horizontally along the X axis.
 The distance by which the coordinates will be shifted is store
in a variable shx also called shearing parameter.
 The predefined matrix is:
P’= S*P
1 shx 0
0 1 0
0 0 1
P’= New Coordinates
S= Shearing Matrix
P= Original Coordinates
Example:
Shx=2
Y
5
4
3
2
1
X’ 0 1 2 3 4 5 6 7 8 9 10 X
Y’
P’= 1 shx 0 1 4 4 1
0 1 0 1 1 3 3
0 0 1 1 1 1 1
P’= 1 shx 0 1 4 4 1
0 1 0 1 1 3 3
0 0 1 1 1 1 1
P’= 1 2 0 1 4 4 1
0 1 0 1 1 3 3
0 0 1 1 1 1 1
P’= 1+2+0 4+2+0 4+6+0 1+6+0
0+1+0 0+1+0 0+3+0 0+3+0
0+0+1 0+0+1 0+0+1 0+0+1
P’= 3 6 10 7
1 1 3 3 (Answer)
1 1 1 1
2. Shearing in Y direction:
 In such shearing the coordinates of the object are shifted
vertically about y axis.
 The distance by which the coordinates are shifted is stored in a
variable shy also called shearing parameter.
 The predefined matrix is:
1 0 0
shy 1 0
0 0 1
P’= S*P
P’= New Coordinates
S= Shearing Matrix
P= Original Coordinates
Example: Y
11
10
9
8
7
6
5
4
3
2
1
X’ 0 1 2 3 4 5 6 7 8 X
Y’
P’= 1 0 0 1 4 4 1
shy 1 0 1 1 3 3
0 0 1 1 1 1 1
P’= 1 0 0 1 4 4 1
2 1 0 1 1 3 3
0 0 1 1 1 1 1
P’= 1+0+0 4+0+0 4+0+0 1+0+0
2+1+0 8+1+0 8+3+0 2+3+0
0+0+1 0+0+1 0+0+1 0+0+1
P’= 1 4 4 1
3 9 11 5 (Answer)
1 1 1 1
Thank You
Presented By
Aditi Patni
Bachelors of Computer Applications
Dezyne E’Cole College
www.dezyneecole.com

More Related Content

PPTX
2d-transformation
PDF
2D Transformation in Computer Graphics
PPS
Overview of 2D and 3D Transformation
PPTX
3d transformation computer graphics
PPTX
3D Transformation
PPTX
Bresenham's line algorithm
PPTX
3D Transformation in Computer Graphics
PPT
2 d geometric transformations
2d-transformation
2D Transformation in Computer Graphics
Overview of 2D and 3D Transformation
3d transformation computer graphics
3D Transformation
Bresenham's line algorithm
3D Transformation in Computer Graphics
2 d geometric transformations

What's hot (20)

PPTX
Projections.pptx
PPT
Polygon clipping
PPT
Composite transformations
PDF
Unit-IV Windowing and Clipping.pdf
PPTX
3D transformation in computer graphics
PPTX
Computer graphics basic transformation
PPT
Two dimensional geometric transformations
PPT
2D transformation (Computer Graphics)
PPT
Shading
PPTX
Bresenham circle
PPT
COMPOSITE TRANSFORMATION COMPUTER GRAPHICDS.ppt
PPT
Z buffer
PPTX
2D viewing & clipping
PPTX
Mid point circle algorithm
PPTX
sutherland- Hodgeman Polygon clipping
PPTX
Attributes of output Primitive
PPTX
COMPUTER GRAPHICS-"Projection"
PDF
3D Transformation
PPTX
The sutherland hodgeman polygon clipping algorithm
PPTX
Projection In Computer Graphics
Projections.pptx
Polygon clipping
Composite transformations
Unit-IV Windowing and Clipping.pdf
3D transformation in computer graphics
Computer graphics basic transformation
Two dimensional geometric transformations
2D transformation (Computer Graphics)
Shading
Bresenham circle
COMPOSITE TRANSFORMATION COMPUTER GRAPHICDS.ppt
Z buffer
2D viewing & clipping
Mid point circle algorithm
sutherland- Hodgeman Polygon clipping
Attributes of output Primitive
COMPUTER GRAPHICS-"Projection"
3D Transformation
The sutherland hodgeman polygon clipping algorithm
Projection In Computer Graphics
Ad

Similar to 2D Transformations(Computer Graphics) (20)

PDF
CG 2D Transformation
PPT
transformation IT.ppt
PPTX
2D transformations
PPT
2 d transformations by amit kumar (maimt)
PPTX
computer graphic.pptx
PDF
2-D Transformations.pdf
PPT
Two dimentional transform
PPTX
UNIT 1 2D AND 3Dtransformations hiutu h.pptx
PPTX
Computer Graphic - Transformations in 2D
PPTX
Computer Graphics - transformations in 2d
PDF
Unit-3 overview of transformations
PPT
2D-Transformations-Transformations are the operations applied to geometrical ...
PPTX
3D Transformation
PPTX
2D Transformation
PPTX
Homogeneous Representation: rotating, shearing
DOC
Unit 3 notes
PPT
Transefermation
PPTX
Presentation3(UNIT-3) presentation of std
PPTX
Unit_IV.pptx..............................
PDF
2D Transformation
CG 2D Transformation
transformation IT.ppt
2D transformations
2 d transformations by amit kumar (maimt)
computer graphic.pptx
2-D Transformations.pdf
Two dimentional transform
UNIT 1 2D AND 3Dtransformations hiutu h.pptx
Computer Graphic - Transformations in 2D
Computer Graphics - transformations in 2d
Unit-3 overview of transformations
2D-Transformations-Transformations are the operations applied to geometrical ...
3D Transformation
2D Transformation
Homogeneous Representation: rotating, shearing
Unit 3 notes
Transefermation
Presentation3(UNIT-3) presentation of std
Unit_IV.pptx..............................
2D Transformation
Ad

Recently uploaded (20)

PDF
Supply Chain Operations Speaking Notes -ICLT Program
PDF
Saundersa Comprehensive Review for the NCLEX-RN Examination.pdf
PDF
O5-L3 Freight Transport Ops (International) V1.pdf
PDF
Anesthesia in Laparoscopic Surgery in India
PDF
Complications of Minimal Access Surgery at WLH
PPTX
Pharma ospi slides which help in ospi learning
PPTX
Cell Types and Its function , kingdom of life
PDF
Abdominal Access Techniques with Prof. Dr. R K Mishra
PPTX
IMMUNITY IMMUNITY refers to protection against infection, and the immune syst...
PDF
TR - Agricultural Crops Production NC III.pdf
PDF
ANTIBIOTICS.pptx.pdf………………… xxxxxxxxxxxxx
PPTX
GDM (1) (1).pptx small presentation for students
PDF
Microbial disease of the cardiovascular and lymphatic systems
PDF
102 student loan defaulters named and shamed – Is someone you know on the list?
PPTX
PPH.pptx obstetrics and gynecology in nursing
PDF
01-Introduction-to-Information-Management.pdf
PDF
grade 11-chemistry_fetena_net_5883.pdf teacher guide for all student
PPTX
PPT- ENG7_QUARTER1_LESSON1_WEEK1. IMAGERY -DESCRIPTIONS pptx.pptx
PDF
O7-L3 Supply Chain Operations - ICLT Program
PPTX
school management -TNTEU- B.Ed., Semester II Unit 1.pptx
Supply Chain Operations Speaking Notes -ICLT Program
Saundersa Comprehensive Review for the NCLEX-RN Examination.pdf
O5-L3 Freight Transport Ops (International) V1.pdf
Anesthesia in Laparoscopic Surgery in India
Complications of Minimal Access Surgery at WLH
Pharma ospi slides which help in ospi learning
Cell Types and Its function , kingdom of life
Abdominal Access Techniques with Prof. Dr. R K Mishra
IMMUNITY IMMUNITY refers to protection against infection, and the immune syst...
TR - Agricultural Crops Production NC III.pdf
ANTIBIOTICS.pptx.pdf………………… xxxxxxxxxxxxx
GDM (1) (1).pptx small presentation for students
Microbial disease of the cardiovascular and lymphatic systems
102 student loan defaulters named and shamed – Is someone you know on the list?
PPH.pptx obstetrics and gynecology in nursing
01-Introduction-to-Information-Management.pdf
grade 11-chemistry_fetena_net_5883.pdf teacher guide for all student
PPT- ENG7_QUARTER1_LESSON1_WEEK1. IMAGERY -DESCRIPTIONS pptx.pptx
O7-L3 Supply Chain Operations - ICLT Program
school management -TNTEU- B.Ed., Semester II Unit 1.pptx

2D Transformations(Computer Graphics)

  • 1. Presented By Aditi Patni Bachelors of Computer Application-Second Year Dezyne E’Cole College, Ajmer COMPUTER GRAPHICS
  • 2. Project report on 2-D Transformations Submitted To Dezyne E’Cole College Towards The Partial Fulfilment Of 2019 Year, Bachelor of Computer Application By Aditi Patni Dezyne E’Cole College 106/10, Civil Line, Ajmer www.dezyneecole.com
  • 3. Acknowledgement I Am Aditi Patni, student of Bachelor of Computer Application, Dezyne E’Cole College. I would like to express my gratitude to each and every person who has contributed in encouraging me and helping me to coordinate my project. I also thank Dezyne E’Cole College who provided insight and expertise that greatly assisted the project. A special thanks to my teachers, parents and colleagues who have supported me at every step. Not to forget, the Almighty who blessed me with good health because of which I worked more efficiently and better.
  • 4. CONTENTS  What is 2-D Transformations?  Basic Transformations  Translation  Rotation  Scaling  Derived Transformations  Reflection  Shearing
  • 5. 2-D TRANSFORMATIONS  Changes in the orientation, shape, size or position of an object, such that the coordinate values of the object changes, is known as 2-D Transformation.  There are two types of transformations: o Basic Transformation o Derived Transformation  The three basic transformations are: o Translation o Rotation o Scaling  From these three basic transformations two more transformation has been derived. They are known as Derived Transformation.  The derived transformation are: o Reflection o Shearing
  • 6. Basic Transformations: Translation:  Translation can be defined as repositioning an object on a straight path from one coordinate location to another coordinate location.  Translation is always considered on a straight path.  The total distance by which an object is translated is known as translation distance.  There are two methods to perform translation: 1. Classic Method: X’=X+Tx Y’=Y+Ty Tx= Translation in x direction Ty= Translation in y direction 2. Modern Method: Q’= T*Q Q’= New Coordinates T= Translation Distance Q= Original Coordinates
  • 7. 1 0 Tx 0 1 Ty 0 0 1 Example: Tx=3, Ty=3 Y X’ 0 1 2 3 4 5 6 7 8 X Y’ By Classic Method: A: X’= 2+3= 5 Y’= 1+3= 4 (5, 4) B: X’= 4+3= 7 Y’= 1+3= 4 (7, 4) C: X’= 3+3= 6 Y’= 3+3= 6 (6, 6) 1 5 4 3 2 6 8 7
  • 8. By Modern Method: Q’= T*Q Q’= 1 0 Tx 2 4 3 0 1 Ty 1 1 3 0 0 1 1 1 1 Q’= 1 0 3 2 4 3 0 1 3 1 1 3 0 0 1 1 1 1 Q’= 2+0+3 4+0+3 3+0+3 0+1+3 0+1+3 0+3+3 0+0+1 0+0+1 0+0+1 Q’= 5 7 6 4 4 6 (Answer) 1 1 1
  • 9. Rotation:  Rotation can be defined as repositioning an object on a circular path from one angle to another.  The fixed point is called the pivot point.  We can rotate an object with five different angles and there is a table with all these values: Angle 0 degree 30 degree 45 degree 60 degree 90 degree Sin 0 0.5 0.70 0.87 1 Cos 1 0.87 0.70 0.5 0  The predefined matrix of rotation is: Cos -Sin 0 Sin Cos 0 0 0 1 Example: Rotation at 90 degree. P’= R*P P’= New Coordinates R= Rotational Matrix P= Original Coordinates
  • 10. Y 5 4 3 2 1 X’ -4 -3 -2 -1 0 1 2 3 4 X Y’ P’= Cos -Sin 0 1 4 1 4 Sin Cos 0 1 1 4 4 0 0 1 1 1 1 1 P’= 0 -1 0 1 4 1 4 1 0 0 1 1 4 4 0 0 1 1 1 1 1 P’= 0-1+0 0-1+0 0-4+0 0-4+0 1+0+0 4+0+0 1+0+0 4+0+0 0+0+1 0+0+1 0+0+1 0+0+1
  • 11. P’= -1 -4 -1 -4 1 4 1 4 (Answer) 1 1 1 1 Scaling:  A scaling transformation changes the size of an object. The size may increase or decrease depending on the coordinate values.  Sx and Sy are scaling factors.  There are two methods to perform scaling: 1. Classic Method: X’= X*Sx Y’= Y*Sy Sx= Scaling in X direction Sy= Scaling in Y direction 2. Modern Method: P’= S*P P’= New Coordinates S= Scaling Matrix P= Original Coordinates
  • 12. Sx 0 0 0 Sy 0 0 0 1 Example: Sx=2, Sy=2 Y X’ 0 1 2 3 4 5 6 7 8 X Y’ 1. Classic Method: A: 2*2=4 1*2=2 (4, 2) 1 5 4 3 2 6 8 7
  • 13. B: 4*2=8 1*2=2 (8, 2) C: 3*2=6 3*2=6 (6, 6) 2. Modern Method: P’= S*P P’= Sx 0 0 2 4 3 0 Sy 0 1 1 3 0 0 1 1 1 1 P’= 2 0 0 2 4 3 0 2 0 1 1 3 0 0 1 1 1 1 P’= 4+0+0 8+0+0 6+0+0 0+2+0 0+2+0 0+6+0 0+0+1 0+0+1 0+0+1 P’= 4 8 6 2 2 6 (Answer) 1 1 1
  • 14. Derived Transformations: Reflection:  In reflection we get the mirror image of an object.  In this transformation, the size or shape of the object do not change.  To perform reflection we need a fixed line known as Reflection Axis.  As reflection has been derived from translation and rotation therefore, it is known as derived transformation.  There are four types of reflection: o Reflection about x axis o Reflection about Y axis o Reflection when the reflection axis passes through origin o Reflection with respect to a diagonal line. 1. Reflection about X axis:  In this the object is reflected with respect to X axis.  The value of X remains same whereas the value of Y becomes negative.  The predefined matrix is: 1 0 0 0 -1 0 0 0 1
  • 15. P’=R*P P’= New Coordinates R= Reflection Matrix P= Original Coordinates Example: Y 5 4 3 2 1 X’ 0 1 2 3 4 5 6 X -1 -2 -3 -4 -5 Y’ P’= 1 0 0 2 6 4 0 -1 0 1 1 4 0 0 1 1 1 1
  • 16. P’= 2+0+0 6+0+0 4+0+0 0-1+0 0-1+0 0-4+0 0+0+1 0+0+1 0+0+1 P’= 2 6 4 -1 -1 -4 (Answer) 1 1 1 2. Reflection about Y axis:  In this the object is reflected with respect of Y axis.  The value of X becomes negative whereas the value of Y remains same.  The predefined matrix is: -1 0 0 0 1 0 0 0 1 Example: P’=S*P P’= -1 0 0 2 6 4 0 1 0 1 1 4 0 0 1 1 1 1
  • 17. P’= -2+0+0 -6+0+0 -4+0+0 0+1+0 0+1+0 0+4+0 0+0+1 0+0+1 0+0+1 P’= -2 -6 -4 1 1 4 (Answer) 1 1 1 Y 5 4 3 2 1 X’ -6 -5 -4 -3 -2 -1 0 1 2 3 4 5 6 X Y’ 3. Reflection when the reflection axis passes through the origin:  In this, the object is rotated around the reflection axis by 180*.  The value of both X and Y coordinates becomes negative.  The predefined matrix is:
  • 18. -1 0 0 0 -1 0 0 0 1 P’=R*P P’= New Coordinates R= Reflection Matrix P= Original Coordinates Example: Y 5 4 3 2 1 X’ -5 -4 -3 -2 -1 0 1 2 3 4 5 X -1 -2 -3 -4 -5 Y’
  • 19. P’=R*P P’= -1 0 0 1 5 3 0 -1 0 1 1 4 0 0 1 1 1 1 P’= -1+0+0 -5+0+0 -3+0+0 0-1+0 0-1+0 0-4+0 0+0+1 0+0+1 0+0+1 P’= -1 -5 -3 -1 -1 -4 1 1 1 4. Reflection with respect to a diagonal line:  In this, the reflection axis and the object are rotated by 45* such that the reflection axis coincides with X axis.  The values of X and y coordinates gets interchanged.  The predefined matrix is: 0 1 0 1 0 0 0 0 1
  • 20. P’=R*P P’= New Coordinates R= Reflection Matrix P= Original Coordinates Example: Y 5 4 3 2 1 X’ 0 1 2 3 4 5 6 X Y’ P’= R*P P’= 0 1 0 3 5 4 1 0 0 1 1 3 0 0 1 1 1 1
  • 21. P’= 0+1+0 0+1+0 0+3+0 3+0+0 5+0+0 4+0+0 0+0+1 0+0+1 0+0+1 P’= 1 1 3 3 5 4 (Answer) 1 1 1 Shearing:  Shearing is a transformation in which the shape of the object changes. During shearing we assume that object is made up of many layers. In shearing the top layer is shifted and the bottom layer remains fixed.  There are two types of shearing: o Shearing in X direction o Shearing in Y direction 1. Shearing in X direction:  In such shearing the coordinates of the object are shifted horizontally along the X axis.  The distance by which the coordinates will be shifted is store in a variable shx also called shearing parameter.  The predefined matrix is: P’= S*P
  • 22. 1 shx 0 0 1 0 0 0 1 P’= New Coordinates S= Shearing Matrix P= Original Coordinates Example: Shx=2 Y 5 4 3 2 1 X’ 0 1 2 3 4 5 6 7 8 9 10 X Y’ P’= 1 shx 0 1 4 4 1 0 1 0 1 1 3 3 0 0 1 1 1 1 1
  • 23. P’= 1 shx 0 1 4 4 1 0 1 0 1 1 3 3 0 0 1 1 1 1 1 P’= 1 2 0 1 4 4 1 0 1 0 1 1 3 3 0 0 1 1 1 1 1 P’= 1+2+0 4+2+0 4+6+0 1+6+0 0+1+0 0+1+0 0+3+0 0+3+0 0+0+1 0+0+1 0+0+1 0+0+1 P’= 3 6 10 7 1 1 3 3 (Answer) 1 1 1 1 2. Shearing in Y direction:  In such shearing the coordinates of the object are shifted vertically about y axis.  The distance by which the coordinates are shifted is stored in a variable shy also called shearing parameter.  The predefined matrix is:
  • 24. 1 0 0 shy 1 0 0 0 1 P’= S*P P’= New Coordinates S= Shearing Matrix P= Original Coordinates Example: Y 11 10 9 8 7 6 5 4 3 2 1 X’ 0 1 2 3 4 5 6 7 8 X Y’
  • 25. P’= 1 0 0 1 4 4 1 shy 1 0 1 1 3 3 0 0 1 1 1 1 1 P’= 1 0 0 1 4 4 1 2 1 0 1 1 3 3 0 0 1 1 1 1 1 P’= 1+0+0 4+0+0 4+0+0 1+0+0 2+1+0 8+1+0 8+3+0 2+3+0 0+0+1 0+0+1 0+0+1 0+0+1 P’= 1 4 4 1 3 9 11 5 (Answer) 1 1 1 1
  • 26. Thank You Presented By Aditi Patni Bachelors of Computer Applications Dezyne E’Cole College www.dezyneecole.com