2. Transformations
“Transformations are the operations applied
to geometrical description of an object to
change its position, orientation, or size are
called geometric transformations”.
3. Why are geometric transformations
necessary?
for positioning geometric objects in 2D and 3D.
for modeling geometric objects in 2D and 3D
For viewing geometric objects in 2D and 3D.
4. translation
• A translation moves all points in an object along the same straight-line path to
new positions.
• The path is represented by a vector, called the translation or shift vector.
• We can write the components:
p'x = px + tx
p'y = py + ty
• or in matrix form:
P' = P + T
5. rotation
• We can write the components:
p'x = px cos – py sin
p'y = px sin + py cos
• or in matrix form:
P' = R • P
• can be clockwise (-ve) or
counterclockwise (+ve as our example).
• Rotation matrix
6. scaling
• Scaling changes the size of an object and involves two scale factors, Sx and
Sy for the x- and y- coordinates respectively.
• Scales are about the origin.
• We can write the components:
• p'x = sx • px
• p'y = sy • py
• or in matrix form:
• P' = S • P
• Scale matrix as:
y
x
s
s
S
0
0
7.
8. Mirror reflection
Reflection is a transformation that produces a mirror image of an
object. It is obtained by rotating the object by 180 deg about the
reflection axis.
𝑀 𝑥 =
1 0
0 −1
𝑀 𝑦 =
−1 0
0 1
9. Shear transformation
• Shear is a transformation that distorts the shape of an object such
that the transformed shape appears as if the object were composed
of internal layers that had been caused to slide over each other
• Two common shearing transformations are those that shift
coordinate x values and those that shift y values
Original Data y Shear x Shear
1 0 0 1 shx 0
shy 1 0 0 1 0
0 0 1 0 0 1
16. projections
Projection is simply projecting a 3-d object to 2-d plane
• In 3D…
o View volume in the world
o Projection onto the 2D projection plane
o A viewport to the view surface
• Process…
o 1… clip against the view volume,
o 2… project to 2D plane, or window,
o 3… map to viewport.
17. 2 types of projections
• Key factor is the center of projection.
o if distance to center of projection is finite : PERSPECTIVE
o if distance to center of projection is infinite : PARALLEL
18. • In perspective projection, object position are transformed
to the view plane along lines that converge to a point called
projection reference point (center of projection)
• In parallel projection, coordinate positions are
transformed to the view plane along parallel lines.
19. • Perspective projection
+ Size varies inversely with distance - looks realistic
– Distance and angles are not (in general) preserved
– Parallel lines do not (in general) remain parallel
• Parallel projection
+ Good for exact measurements
+ Parallel lines remain parallel
– Angles are not (in general) preserved
– Less realistic looking
22. Types of parallel projections
• We can define a parallel projection with a projection vector that
defines the direction for the projection lines.
2 types:
• Orthographic : when the projection is perpendicular to the view
plane. In short,
o direction of projection = normal to the projection plane.
o the projection is perpendicular to the view plane.
• Oblique : when the projection is not perpendicular to the view
plane. In short,
o direction of projection normal to the projection plane.
o Not perpendicular