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

What's hot

3D transformation in computer graphics
3D transformation in computer graphics3D transformation in computer graphics
3D transformation in computer graphics
SHIVANI SONI
 
2 d geometric transformations
2 d geometric transformations2 d geometric transformations
2 d geometric transformations
Mohd Arif
 
2 d viewing computer graphics
2 d viewing computer graphics2 d viewing computer graphics
2 d viewing computer graphics
KALESHWAR KUMAR
 
Clipping
ClippingClipping
Clipping
Mohd Arif
 
Composite transformations
Composite transformationsComposite transformations
Composite transformations
Mohd Arif
 
Line drawing algo.
Line drawing algo.Line drawing algo.
Line drawing algo.
Mohd Arif
 
Clipping in Computer Graphics
Clipping in Computer GraphicsClipping in Computer Graphics
Clipping in Computer Graphics
Laxman Puri
 
Projection In Computer Graphics
Projection In Computer GraphicsProjection In Computer Graphics
Projection In Computer Graphics
Sanu Philip
 
4. THREE DIMENSIONAL DISPLAY METHODS
4.	THREE DIMENSIONAL DISPLAY METHODS4.	THREE DIMENSIONAL DISPLAY METHODS
4. THREE DIMENSIONAL DISPLAY METHODS
SanthiNivas
 
Cyrus beck line clipping algorithm
Cyrus beck line clipping algorithmCyrus beck line clipping algorithm
Cyrus beck line clipping algorithm
Pooja Dixit
 
Computer graphics
Computer graphicsComputer graphics
Computer graphics
Nanhen Verma
 
Computer Graphics - Output Primitive
Computer Graphics - Output PrimitiveComputer Graphics - Output Primitive
Computer Graphics - Output Primitive
Rupesh Mishra
 
Bressenham’s Midpoint Circle Drawing Algorithm
Bressenham’s Midpoint Circle Drawing AlgorithmBressenham’s Midpoint Circle Drawing Algorithm
Bressenham’s Midpoint Circle Drawing Algorithm
Mrinmoy Dalal
 
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
 
Part 2- Geometric Transformation.pptx
Part 2- Geometric Transformation.pptxPart 2- Geometric Transformation.pptx
Part 2- Geometric Transformation.pptx
Khalil Alhatab
 
Circle generation algorithm
Circle generation algorithmCircle generation algorithm
Circle generation algorithm
Ankit Garg
 
3 d viewing
3 d viewing3 d viewing
3 d viewing
Deepak Singh
 
KEY FRAME SYSTEM-Ruby Stella mary.pptx
KEY FRAME SYSTEM-Ruby Stella mary.pptxKEY FRAME SYSTEM-Ruby Stella mary.pptx
KEY FRAME SYSTEM-Ruby Stella mary.pptx
ComputerScienceDepar6
 
Unit 3
Unit 3Unit 3
Unit 3
ypnrao
 
Bresenham circle
Bresenham circleBresenham circle
Bresenham circle
Taher Barodawala
 

What's hot (20)

3D transformation in computer graphics
3D transformation in computer graphics3D transformation in computer graphics
3D transformation in computer graphics
 
2 d geometric transformations
2 d geometric transformations2 d geometric transformations
2 d geometric transformations
 
2 d viewing computer graphics
2 d viewing computer graphics2 d viewing computer graphics
2 d viewing computer graphics
 
Clipping
ClippingClipping
Clipping
 
Composite transformations
Composite transformationsComposite transformations
Composite transformations
 
Line drawing algo.
Line drawing algo.Line drawing algo.
Line drawing algo.
 
Clipping in Computer Graphics
Clipping in Computer GraphicsClipping in Computer Graphics
Clipping in Computer Graphics
 
Projection In Computer Graphics
Projection In Computer GraphicsProjection In Computer Graphics
Projection In Computer Graphics
 
4. THREE DIMENSIONAL DISPLAY METHODS
4.	THREE DIMENSIONAL DISPLAY METHODS4.	THREE DIMENSIONAL DISPLAY METHODS
4. THREE DIMENSIONAL DISPLAY METHODS
 
Cyrus beck line clipping algorithm
Cyrus beck line clipping algorithmCyrus beck line clipping algorithm
Cyrus beck line clipping algorithm
 
Computer graphics
Computer graphicsComputer graphics
Computer graphics
 
Computer Graphics - Output Primitive
Computer Graphics - Output PrimitiveComputer Graphics - Output Primitive
Computer Graphics - Output Primitive
 
Bressenham’s Midpoint Circle Drawing Algorithm
Bressenham’s Midpoint Circle Drawing AlgorithmBressenham’s Midpoint Circle Drawing Algorithm
Bressenham’s Midpoint Circle Drawing Algorithm
 
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)
 
Part 2- Geometric Transformation.pptx
Part 2- Geometric Transformation.pptxPart 2- Geometric Transformation.pptx
Part 2- Geometric Transformation.pptx
 
Circle generation algorithm
Circle generation algorithmCircle generation algorithm
Circle generation algorithm
 
3 d viewing
3 d viewing3 d viewing
3 d viewing
 
KEY FRAME SYSTEM-Ruby Stella mary.pptx
KEY FRAME SYSTEM-Ruby Stella mary.pptxKEY FRAME SYSTEM-Ruby Stella mary.pptx
KEY FRAME SYSTEM-Ruby Stella mary.pptx
 
Unit 3
Unit 3Unit 3
Unit 3
 
Bresenham circle
Bresenham circleBresenham circle
Bresenham circle
 

Similar to 2D Transformations(Computer Graphics)

CG 2D Transformation
CG 2D TransformationCG 2D Transformation
CG 2D Transformation
MohitModyani
 
2-D transformation
2-D transformation 2-D transformation
2-D transformation
VishalLoungani
 
2D Transformation.pdf
2D Transformation.pdf2D Transformation.pdf
2D Transformation.pdf
maheshshinde762539
 
2-D Transformations.pdf
2-D Transformations.pdf2-D Transformations.pdf
2-D Transformations.pdf
Mattupallipardhu
 
Computer Graphic - Transformations in 2D
Computer Graphic - Transformations in 2DComputer Graphic - Transformations in 2D
Computer Graphic - Transformations in 2D
2013901097
 
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
 
3 d geometric transformations
3 d geometric transformations3 d geometric transformations
3 d geometric transformations
Mohd Arif
 
transformation IT.ppt
transformation IT.ppttransformation IT.ppt
transformation IT.ppt
ShubhamBatwani
 
Lec05 circle ellipse
Lec05 circle ellipseLec05 circle ellipse
Lec05 circle ellipse
Maaz Rizwan
 
2D Translation.pdf
2D Translation.pdf2D Translation.pdf
2D Translation.pdf
MehulMunshi3
 
2D-transformation-1.pdf
2D-transformation-1.pdf2D-transformation-1.pdf
2D-transformation-1.pdf
bcanawakadalcollege
 
Computer Graphic - Transformations in 3d
Computer Graphic - Transformations in 3dComputer Graphic - Transformations in 3d
Computer Graphic - Transformations in 3d
2013901097
 
Computer Graphics - transformations in 3d
Computer Graphics - transformations in 3dComputer Graphics - transformations in 3d
Computer Graphics - transformations in 3d
Hisham Al Kurdi, EAVA, DMC-D-4K, HCCA-P, HCAA-D
 
Quadratic equation.pptx
Quadratic equation.pptxQuadratic equation.pptx
Quadratic equation.pptx
Thuthuka Mahlangu
 
Coordinate transformation
Coordinate transformationCoordinate transformation
Coordinate transformation
Mohd Arif
 
Unit circle
Unit circleUnit circle
Unit circle
Neil MacIntosh
 
2D Transformation in Computer Graphics
2D Transformation in Computer Graphics2D Transformation in Computer Graphics
2D Transformation in Computer Graphics
A. S. M. Shafi
 
Mid-Point Cirle Drawing Algorithm
Mid-Point Cirle Drawing AlgorithmMid-Point Cirle Drawing Algorithm
Mid-Point Cirle Drawing Algorithm
Neha Kaurav
 
Coordinatetransformation 130405095156-phpapp01-converted
Coordinatetransformation 130405095156-phpapp01-convertedCoordinatetransformation 130405095156-phpapp01-converted
Coordinatetransformation 130405095156-phpapp01-converted
the university of Lahore
 
X2 t08 03 inequalities & graphs (2013)
X2 t08 03 inequalities & graphs (2013)X2 t08 03 inequalities & graphs (2013)
X2 t08 03 inequalities & graphs (2013)
Nigel Simmons
 

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

CG 2D Transformation
CG 2D TransformationCG 2D Transformation
CG 2D Transformation
 
2-D transformation
2-D transformation 2-D transformation
2-D transformation
 
2D Transformation.pdf
2D Transformation.pdf2D Transformation.pdf
2D Transformation.pdf
 
2-D Transformations.pdf
2-D Transformations.pdf2-D Transformations.pdf
2-D Transformations.pdf
 
Computer Graphic - Transformations in 2D
Computer Graphic - Transformations in 2DComputer Graphic - Transformations in 2D
Computer Graphic - Transformations in 2D
 
Computer Graphics - transformations in 2d
Computer Graphics - transformations in 2dComputer Graphics - transformations in 2d
Computer Graphics - transformations in 2d
 
3 d geometric transformations
3 d geometric transformations3 d geometric transformations
3 d geometric transformations
 
transformation IT.ppt
transformation IT.ppttransformation IT.ppt
transformation IT.ppt
 
Lec05 circle ellipse
Lec05 circle ellipseLec05 circle ellipse
Lec05 circle ellipse
 
2D Translation.pdf
2D Translation.pdf2D Translation.pdf
2D Translation.pdf
 
2D-transformation-1.pdf
2D-transformation-1.pdf2D-transformation-1.pdf
2D-transformation-1.pdf
 
Computer Graphic - Transformations in 3d
Computer Graphic - Transformations in 3dComputer Graphic - Transformations in 3d
Computer Graphic - Transformations in 3d
 
Computer Graphics - transformations in 3d
Computer Graphics - transformations in 3dComputer Graphics - transformations in 3d
Computer Graphics - transformations in 3d
 
Quadratic equation.pptx
Quadratic equation.pptxQuadratic equation.pptx
Quadratic equation.pptx
 
Coordinate transformation
Coordinate transformationCoordinate transformation
Coordinate transformation
 
Unit circle
Unit circleUnit circle
Unit circle
 
2D Transformation in Computer Graphics
2D Transformation in Computer Graphics2D Transformation in Computer Graphics
2D Transformation in Computer Graphics
 
Mid-Point Cirle Drawing Algorithm
Mid-Point Cirle Drawing AlgorithmMid-Point Cirle Drawing Algorithm
Mid-Point Cirle Drawing Algorithm
 
Coordinatetransformation 130405095156-phpapp01-converted
Coordinatetransformation 130405095156-phpapp01-convertedCoordinatetransformation 130405095156-phpapp01-converted
Coordinatetransformation 130405095156-phpapp01-converted
 
X2 t08 03 inequalities & graphs (2013)
X2 t08 03 inequalities & graphs (2013)X2 t08 03 inequalities & graphs (2013)
X2 t08 03 inequalities & graphs (2013)
 

Recently uploaded

Gender and Mental Health - Counselling and Family Therapy Applications and In...
Gender and Mental Health - Counselling and Family Therapy Applications and In...Gender and Mental Health - Counselling and Family Therapy Applications and In...
Gender and Mental Health - Counselling and Family Therapy Applications and In...
PsychoTech Services
 
Beyond Degrees - Empowering the Workforce in the Context of Skills-First.pptx
Beyond Degrees - Empowering the Workforce in the Context of Skills-First.pptxBeyond Degrees - Empowering the Workforce in the Context of Skills-First.pptx
Beyond Degrees - Empowering the Workforce in the Context of Skills-First.pptx
EduSkills OECD
 
Advanced Java[Extra Concepts, Not Difficult].docx
Advanced Java[Extra Concepts, Not Difficult].docxAdvanced Java[Extra Concepts, Not Difficult].docx
Advanced Java[Extra Concepts, Not Difficult].docx
adhitya5119
 
คำศัพท์ คำพื้นฐานการอ่าน ภาษาอังกฤษ ระดับชั้น ม.1
คำศัพท์ คำพื้นฐานการอ่าน ภาษาอังกฤษ ระดับชั้น ม.1คำศัพท์ คำพื้นฐานการอ่าน ภาษาอังกฤษ ระดับชั้น ม.1
คำศัพท์ คำพื้นฐานการอ่าน ภาษาอังกฤษ ระดับชั้น ม.1
สมใจ จันสุกสี
 
Walmart Business+ and Spark Good for Nonprofits.pdf
Walmart Business+ and Spark Good for Nonprofits.pdfWalmart Business+ and Spark Good for Nonprofits.pdf
Walmart Business+ and Spark Good for Nonprofits.pdf
TechSoup
 
spot a liar (Haiqa 146).pptx Technical writhing and presentation skills
spot a liar (Haiqa 146).pptx Technical writhing and presentation skillsspot a liar (Haiqa 146).pptx Technical writhing and presentation skills
spot a liar (Haiqa 146).pptx Technical writhing and presentation skills
haiqairshad
 
clinical examination of hip joint (1).pdf
clinical examination of hip joint (1).pdfclinical examination of hip joint (1).pdf
clinical examination of hip joint (1).pdf
Priyankaranawat4
 
Main Java[All of the Base Concepts}.docx
Main Java[All of the Base Concepts}.docxMain Java[All of the Base Concepts}.docx
Main Java[All of the Base Concepts}.docx
adhitya5119
 
Liberal Approach to the Study of Indian Politics.pdf
Liberal Approach to the Study of Indian Politics.pdfLiberal Approach to the Study of Indian Politics.pdf
Liberal Approach to the Study of Indian Politics.pdf
WaniBasim
 
Présentationvvvvvvvvvvvvvvvvvvvvvvvvvvvv2.pptx
Présentationvvvvvvvvvvvvvvvvvvvvvvvvvvvv2.pptxPrésentationvvvvvvvvvvvvvvvvvvvvvvvvvvvv2.pptx
Présentationvvvvvvvvvvvvvvvvvvvvvvvvvvvv2.pptx
siemaillard
 
LAND USE LAND COVER AND NDVI OF MIRZAPUR DISTRICT, UP
LAND USE LAND COVER AND NDVI OF MIRZAPUR DISTRICT, UPLAND USE LAND COVER AND NDVI OF MIRZAPUR DISTRICT, UP
LAND USE LAND COVER AND NDVI OF MIRZAPUR DISTRICT, UP
RAHUL
 
The basics of sentences session 6pptx.pptx
The basics of sentences session 6pptx.pptxThe basics of sentences session 6pptx.pptx
The basics of sentences session 6pptx.pptx
heathfieldcps1
 
How to Setup Warehouse & Location in Odoo 17 Inventory
How to Setup Warehouse & Location in Odoo 17 InventoryHow to Setup Warehouse & Location in Odoo 17 Inventory
How to Setup Warehouse & Location in Odoo 17 Inventory
Celine George
 
Mule event processing models | MuleSoft Mysore Meetup #47
Mule event processing models | MuleSoft Mysore Meetup #47Mule event processing models | MuleSoft Mysore Meetup #47
Mule event processing models | MuleSoft Mysore Meetup #47
MysoreMuleSoftMeetup
 
Constructing Your Course Container for Effective Communication
Constructing Your Course Container for Effective CommunicationConstructing Your Course Container for Effective Communication
Constructing Your Course Container for Effective Communication
Chevonnese Chevers Whyte, MBA, B.Sc.
 
How to Create a More Engaging and Human Online Learning Experience
How to Create a More Engaging and Human Online Learning Experience How to Create a More Engaging and Human Online Learning Experience
How to Create a More Engaging and Human Online Learning Experience
Wahiba Chair Training & Consulting
 
Hindi varnamala | hindi alphabet PPT.pdf
Hindi varnamala | hindi alphabet PPT.pdfHindi varnamala | hindi alphabet PPT.pdf
Hindi varnamala | hindi alphabet PPT.pdf
Dr. Mulla Adam Ali
 
RHEOLOGY Physical pharmaceutics-II notes for B.pharm 4th sem students
RHEOLOGY Physical pharmaceutics-II notes for B.pharm 4th sem studentsRHEOLOGY Physical pharmaceutics-II notes for B.pharm 4th sem students
RHEOLOGY Physical pharmaceutics-II notes for B.pharm 4th sem students
Himanshu Rai
 
What is Digital Literacy? A guest blog from Andy McLaughlin, University of Ab...
What is Digital Literacy? A guest blog from Andy McLaughlin, University of Ab...What is Digital Literacy? A guest blog from Andy McLaughlin, University of Ab...
What is Digital Literacy? A guest blog from Andy McLaughlin, University of Ab...
GeorgeMilliken2
 
BBR 2024 Summer Sessions Interview Training
BBR  2024 Summer Sessions Interview TrainingBBR  2024 Summer Sessions Interview Training
BBR 2024 Summer Sessions Interview Training
Katrina Pritchard
 

Recently uploaded (20)

Gender and Mental Health - Counselling and Family Therapy Applications and In...
Gender and Mental Health - Counselling and Family Therapy Applications and In...Gender and Mental Health - Counselling and Family Therapy Applications and In...
Gender and Mental Health - Counselling and Family Therapy Applications and In...
 
Beyond Degrees - Empowering the Workforce in the Context of Skills-First.pptx
Beyond Degrees - Empowering the Workforce in the Context of Skills-First.pptxBeyond Degrees - Empowering the Workforce in the Context of Skills-First.pptx
Beyond Degrees - Empowering the Workforce in the Context of Skills-First.pptx
 
Advanced Java[Extra Concepts, Not Difficult].docx
Advanced Java[Extra Concepts, Not Difficult].docxAdvanced Java[Extra Concepts, Not Difficult].docx
Advanced Java[Extra Concepts, Not Difficult].docx
 
คำศัพท์ คำพื้นฐานการอ่าน ภาษาอังกฤษ ระดับชั้น ม.1
คำศัพท์ คำพื้นฐานการอ่าน ภาษาอังกฤษ ระดับชั้น ม.1คำศัพท์ คำพื้นฐานการอ่าน ภาษาอังกฤษ ระดับชั้น ม.1
คำศัพท์ คำพื้นฐานการอ่าน ภาษาอังกฤษ ระดับชั้น ม.1
 
Walmart Business+ and Spark Good for Nonprofits.pdf
Walmart Business+ and Spark Good for Nonprofits.pdfWalmart Business+ and Spark Good for Nonprofits.pdf
Walmart Business+ and Spark Good for Nonprofits.pdf
 
spot a liar (Haiqa 146).pptx Technical writhing and presentation skills
spot a liar (Haiqa 146).pptx Technical writhing and presentation skillsspot a liar (Haiqa 146).pptx Technical writhing and presentation skills
spot a liar (Haiqa 146).pptx Technical writhing and presentation skills
 
clinical examination of hip joint (1).pdf
clinical examination of hip joint (1).pdfclinical examination of hip joint (1).pdf
clinical examination of hip joint (1).pdf
 
Main Java[All of the Base Concepts}.docx
Main Java[All of the Base Concepts}.docxMain Java[All of the Base Concepts}.docx
Main Java[All of the Base Concepts}.docx
 
Liberal Approach to the Study of Indian Politics.pdf
Liberal Approach to the Study of Indian Politics.pdfLiberal Approach to the Study of Indian Politics.pdf
Liberal Approach to the Study of Indian Politics.pdf
 
Présentationvvvvvvvvvvvvvvvvvvvvvvvvvvvv2.pptx
Présentationvvvvvvvvvvvvvvvvvvvvvvvvvvvv2.pptxPrésentationvvvvvvvvvvvvvvvvvvvvvvvvvvvv2.pptx
Présentationvvvvvvvvvvvvvvvvvvvvvvvvvvvv2.pptx
 
LAND USE LAND COVER AND NDVI OF MIRZAPUR DISTRICT, UP
LAND USE LAND COVER AND NDVI OF MIRZAPUR DISTRICT, UPLAND USE LAND COVER AND NDVI OF MIRZAPUR DISTRICT, UP
LAND USE LAND COVER AND NDVI OF MIRZAPUR DISTRICT, UP
 
The basics of sentences session 6pptx.pptx
The basics of sentences session 6pptx.pptxThe basics of sentences session 6pptx.pptx
The basics of sentences session 6pptx.pptx
 
How to Setup Warehouse & Location in Odoo 17 Inventory
How to Setup Warehouse & Location in Odoo 17 InventoryHow to Setup Warehouse & Location in Odoo 17 Inventory
How to Setup Warehouse & Location in Odoo 17 Inventory
 
Mule event processing models | MuleSoft Mysore Meetup #47
Mule event processing models | MuleSoft Mysore Meetup #47Mule event processing models | MuleSoft Mysore Meetup #47
Mule event processing models | MuleSoft Mysore Meetup #47
 
Constructing Your Course Container for Effective Communication
Constructing Your Course Container for Effective CommunicationConstructing Your Course Container for Effective Communication
Constructing Your Course Container for Effective Communication
 
How to Create a More Engaging and Human Online Learning Experience
How to Create a More Engaging and Human Online Learning Experience How to Create a More Engaging and Human Online Learning Experience
How to Create a More Engaging and Human Online Learning Experience
 
Hindi varnamala | hindi alphabet PPT.pdf
Hindi varnamala | hindi alphabet PPT.pdfHindi varnamala | hindi alphabet PPT.pdf
Hindi varnamala | hindi alphabet PPT.pdf
 
RHEOLOGY Physical pharmaceutics-II notes for B.pharm 4th sem students
RHEOLOGY Physical pharmaceutics-II notes for B.pharm 4th sem studentsRHEOLOGY Physical pharmaceutics-II notes for B.pharm 4th sem students
RHEOLOGY Physical pharmaceutics-II notes for B.pharm 4th sem students
 
What is Digital Literacy? A guest blog from Andy McLaughlin, University of Ab...
What is Digital Literacy? A guest blog from Andy McLaughlin, University of Ab...What is Digital Literacy? A guest blog from Andy McLaughlin, University of Ab...
What is Digital Literacy? A guest blog from Andy McLaughlin, University of Ab...
 
BBR 2024 Summer Sessions Interview Training
BBR  2024 Summer Sessions Interview TrainingBBR  2024 Summer Sessions Interview Training
BBR 2024 Summer Sessions Interview Training
 

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