Call Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service Nashik
Transefermation
1. Computer Graphics
12/28/16 T.L. SAHU CSE SRIT II RAIPUR 1
• Computer graphics are visual
representations of data displayed on a
monitor made on a computer. Computer
graphics can be a series of images (most
often called video) or a single image.
5. 2D Transformations
Problem:
• Given a 2D object, the transformation is the change
in the object:
– Position (translation)
– Size (scaling)
– Orientation (rotation)
– Shapes (shear)
Solution:
• Construct a sequence of matrices that can be applied
to all the points of the object.12/28/16 T.L. SAHU CSE SRIT II RAIPUR 5
6. 2D Transformations
• World Coordinates
• Translate
• Rotate
• Scale
• Viewport Transforms
• Putting it all together
12/28/16 T.L. SAHU CSE SRIT II RAIPUR 6
7. Transformations
• Rigid Body Transformations - transformations that do not
change the object.
• Translate
– If you translate a rectangle, it is still a rectangle
• Scale
– If you scale a rectangle, it is still a rectangle
• Rotate
– If you rotate a rectangle, it is still a rectangle
12/28/16 T.L. SAHU CSE SRIT II RAIPUR 7
8. Vertices
• We have always represented vertices as
(x,y)
• An alternate method is:
• Example:
=
y
x
yx ),(
=
8.4
1.2
)8.4,1.2(
12/28/16 T.L. SAHU CSE SRIT II RAIPUR 8
11. Translation
• Translation - repositioning an object along
a straight-line path (the translation
distances) from one coordinate location to
another.
(x,y)
(x’,y’)
(tx,ty)
12/28/16 T.L. SAHU CSE SRIT II RAIPUR 11
12. Translation
Translation is a process of changing the
position of an object in a straight line path
from one coordinate location to another.
x’= x+tx
y’=y+ty
12/28/16 T.L. SAHU CSE SRIT II RAIPUR 12
16. Translation Operation
12/28/16 T.L. SAHU CSE SRIT II RAIPUR
Coordinates:
Matrix Form:
y
x
tyy
txx
+=
+=
'
'
+
=
y
x
t
t
y
x
y
x
'
'
16
17. Translation
• Given:
• We want:
• Matrix form:
TPP
t
t
y
x
y
x
tyy
txx
ttT
yxP
y
x
y
x
yx
+=
+
=
+=
+=
=
=
'
'
'
'
'
),(
),(
1.4'
4.3'
2.8
1.7
1.4
7.3
'
'
2.81.4'
1.77.3'
)2.8,1.7(
)1.4,7.3(
=
=
+
−
−
=
+−=
+−=
=
−−=
y
x
y
x
y
x
T
P
12/28/16 T.L. SAHU CSE SRIT II RAIPUR 17
20. Scale
• Scale - Alters the size of an object.
• Scales about a fixed point
(x,y)
(x’,y’)
12/28/16 T.L. SAHU CSE SRIT II RAIPUR 20
21. Scaling
• A scaling transformation changes the size of an object.
• Any positive numeric values are valid for scaling factor Sx
and Sy.
• Sx and Sy values <1 reduces the size of object.
• Sx and Sy values >1 produce an enlarged object.
• Sx and Sy values =1 size of object does not change.
• Sx = Sy : uniform scaling
• Sx ≠ Sy : differential scaling
12/28/16 T.L. SAHU CSE SRIT II RAIPUR 21
25. Scaling Operation
12/28/16 T.L. SAHU CSE SRIT II RAIPUR
Coordinates:
Matrix Form:
y
x
syy
sxx
×=
×=
'
'
=
y
x
s
s
y
x
y
x
0
0
'
'
P(x, y) ->P’ (x’, y’)
P’ -> S . P
25
29. Rotation
• Rotation - repositions an object along a
circular path.
• Rotation requires an Θ and a pivot point
12/28/16 T.L. SAHU CSE SRIT II RAIPUR 29
30. Rotation
A two dimensional rotation is applied to an
object by repositioning it along a circular
path in the xy plane. To generate a rotation
angle θ and the position of the rotation
point about object is to be rotated.
12/28/16 T.L. SAHU CSE SRIT II RAIPUR 30