L4 - II Computer Graphics
L4 - II Computer Graphics
TRANSFORMATIONS II
Unit Structure
4.0 Objectives
4.1 Introduction
4.2 Rotation
4.3 Translation
4.4 Rotation about an Arbitrary Point
4.5 Combined Transformation
4.6 Homogeneous Coordinates
4.7 2D Transformations using Homogeneous Coordinates
4.8 Let us sum up
4.9 References and Suggested Reading
4.0 OBJECTIVES
The objective of this chapter is
• To understand 2D rotation transformation.
• To understand 2D translation transformations.
• To understand two dimensional combined transformations.
• To understand homogenous coordinates and 2D
transformation using homogenous coordinates.
• To understand Shear transformations in 2D.
4.1 INTRODUCTION
• This chapter is the extension of the previous chapter in which we will
discuss the rotation transformation about any point. We will also
learn about the translation transformation in which the position of an
object changes. The homogenous coordinates and 2D transformation
using homogenous coordinates will also be explained.
4.2 ROTATION
• In rotation transformation, an object is repositioned along a circular
path in the xy plane. The rotation is performed with certain angle θ,
known as rotation angle. Rotation can be performed in two ways:
about origin or about an arbitrary point called as rotation point or
pivot point.
Rotation about origin:
The pivot point here is the origin. We can obtain transformation
equations for rotating a point (x, y) through an angleθ to obtain final
point as (x’, y’) with the help of figure as
x' = x cosθ – y sinθ y' = x sinθ + y cosθ
𝑐𝑜𝑠𝜃 −𝑠𝑖𝑛𝜃
The transformation matrix for rotation can be written as 𝑅=
𝑠𝑖𝑛𝜃 𝑐𝑜𝑠𝜃
ROTATION ABOUT AN ARBITRARY POINT
𝑡𝑥
• P= 𝑥1 , P’= 𝑥1 , 𝑇=
𝑡𝑦
𝑦1 𝑦1
The figure below shows the translation of an object. Here coordinate
points defining the object are translated and then it is reconstructed.
• For rotation
𝑥′ 𝑐𝑜𝑠𝜃 − 𝑠𝑖𝑛𝜃 0 𝑥
𝑦′ = 𝑠𝑖𝑛𝜃 𝑐𝑜𝑠𝜃 0 . 𝑦
1 0 0 1 1
• For scaling
𝑥′ 𝑠𝑥 0 0 𝑥
𝑦′ = 0 𝑠𝑦 0 . 𝑦
1 0 0 1 1
Check your progress: