2D transformation (Computer Graphics)

30,125 views 29 slides Aug 10, 2019
Slide 1
Slide 1 of 29
Slide 1
1
Slide 2
2
Slide 3
3
Slide 4
4
Slide 5
5
Slide 6
6
Slide 7
7
Slide 8
8
Slide 9
9
Slide 10
10
Slide 11
11
Slide 12
12
Slide 13
13
Slide 14
14
Slide 15
15
Slide 16
16
Slide 17
17
Slide 18
18
Slide 19
19
Slide 20
20
Slide 21
21
Slide 22
22
Slide 23
23
Slide 24
24
Slide 25
25
Slide 26
26
Slide 27
27
Slide 28
28
Slide 29
29

About This Presentation

with today's advanced technology like photoshop, paint etc. we need to understand some basic concepts like how they are cropping the image , tilt the image etc.
In our presentation you will find basic introduction of 2D transformation.


Slide Content

2D TRANSFORMATIONS
COMPUTER GRAPHICS

2D Transformations
“Transformations are the operations applied to
geometrical description of an object to change its
position, orientation, or size are called geometric
transformations”.

Translation
Translation is a process of changing the position
of an object in a straight-line path from one co-
ordinate location to another.
We can translate a two dimensional point by
adding translation distances, tx and ty.
Suppose the original position is (x ,y) then new
position is (x’, y’).
Here x’=x + tx and y’=y + ty.

Click icon to add picture

Translation

Matrix form of the equations:
X’ = X + tx and Y’ = Y + ty is
P = x P’ = x’ T= tx
y y’ ty
 we can write it,
P’= P + T

Translate a polygon with co-ordinates A(2,5) B(7,10) and C(10,2) by 3
units in X direction and 4 units in Y direction.
 A’ = A +T
= 2 + 3 = 5
5 4 9
 B’ = B + T
= 7 + 3 = 10
10 4 14
 C’ = C + T
= 10 + 3 = 13
2 4 7

Rotation
A two dimensional rotation is applied to an object by
repositioning it along a circular path in the xy plane.
Using standard trigonometric equations , we can express
the transformed co-ordinates in terms of
x’ = r cos( coscosr sinsin
y’ = r sin( cosr sin
The original co-ordinates of the point is
x = r cos
y = r sin
 

Click icon to add picture
After substituting equation 2 in equation 1 we get
x’=x cos
Y’=x sin + y cos
 

Rotation

That equation can be represented in matrix form
x’ y’ = x y cos
-sin cos
 we can write this equation as,
P’ = P . R
Where R is a rotation matrix and it is given as
R = cos
-sin cos
 

 A point (4,3) is rotated counterclockwise by angle of 45.
find the rotation matrix and the resultant point.
 R = cos = cos45 sin45
- cos -sin45 cos45
= 1/√2 1/√2
- 1/√2 1/√2
P’ = 4 3 1/√2 1/√2
- 1/√2 1/√2
= 4/√2 – 3/√2 4/√2 + 3/√2
= 1/√2 7/√2
 

Scaling
A scaling transformation changes the size of an object.
This operation can be carried out for polygons by
multiplying the co-ordinates values (x , y) of each vertex
by scaling factors Sx and Sy to produce the transformed
co-ordinates (x’ , y’).
x’ = x . Sx
y’ = y . Sy
In the matrix form
x’ y’ = x y Sx 0
0 Sy
= P . S

Scaling
• Uniform Scaling Un-uniform Scaling

Homogeneous co-ordinates for Translation
The homogeneous co-ordinates for translation are given as
T = 1 0 0
0 1 0
tx ty 1
 Therefore , we have
x’ y’ 1 = x y 1 1 0 0
0 1 0
tx ty 1
= x + tx y + ty 1

Homogeneous co-ordinates for rotation
The homogeneous co-ordinates for rotation are given as
R = cos sin
-sin cos
0 0 1
Therefore , we have
x’ y’ 1 = x y 1 cos sin
-sin cos
0 0 1
= x cos - y sin x sin + y cos 1
 

Homogeneous co-ordinates for scaling
The homogeneous co-ordinate for scaling are given as
S = Sx 0 0
0 Sy 0
0 0 1
Therefore , we have
x’ y’ 1 = x y 1 Sx 0 0
0 Sy 0
0 0 1
= x . Sx y . Sy 1

CONCLUSION
To manipulate the initially created
object and to display the
modified object without having to
redraw it, we use
Transformations.

THANK YOU