Professional Documents
Culture Documents
– UNIT V
Geometric Objects & Transformations
By K. Satyanarayan Reddy, Professor
Dept. of CSE,
Cambridge Institute of Technology,
Bangalore - 36
TRANSLATION, ROTATION, AND SCALING
Introduce Standard Transformations
Rotation
Translation
Scaling
Shear
Derive homogeneous coordinate transformation matrices
Learn to build arbitrary transformation matrices from simple
transformations
v=T(u)
u T(u) T(u)
vertices vertices pixels
v
K. Satyanarayan Reddy, Professor, CiTech,
April 29, 2011
Bangalore - 560036.
5
Notation
We will be working with both coordinate free representations of
Transformations and Representations within a particular
frame
P,Q, R: points in an affine space
u, v, w: vectors in an affine space
α, β, γ: scalars
p, q, r: representations of points
- Array of 4 scalars in homogeneous coordinates
u, v, w: representations of points
- Array of 4 scalars in homogeneous
coordinates
P’
z
d
y
P
x
Displacement determined by a vector d
There are 3 degrees of freedom
P’= P + d
x = r cos φ
y = r sin φ
sx = -1 sy = -1 sx = 1 sy = -1
K. Satyanarayan Reddy, Professor, CiTech,
April 29, 2011 17
Bangalore - 560036.
TRANSFORMATIONS IN HOMOGENEOUS COORDINATES
All graphics APIs force us to work within some reference system.
Hence, we cannot work with high-level expressions such as
Instead, we work with representations in homogeneous
coordinates and with expressions such as
Within a frame, each affine transformation is represented by a
4 x 4 matrix of the form
cos θ − sin θ 0 0
sin θ cos θ 0 0
R = Rz(θ) =
0 0 1 0
0 0 0 1
K. Satyanarayan Reddy, Professor, CiTech,
April 29, 2011
Bangalore - 560036. 24
Rotation about X and Y axes
Same argument as for rotation about z axis
For rotation about X axis, x is unchanged
For rotation about Y axis, y is unchanged
1 0 0 0
0 cos θ - sin θ 0
R = Rx(θ) =
0 sin θ cos θ 0
0 0 0 1
cos θ 0 sin θ 0
0 1 0 0
R = Ry(θ) =
- sin θ 0 cos θ 0
0 0 0 1
K. Satyanarayan Reddy, Professor, CiTech,
April 29, 2011
Bangalore - 560036. 25
Rotation cont’d….
The signs of the sine terms are consistent with the
definition of a positive rotation in a right-handed
system.
Suppose that R denotes any of the three rotation
matrices. A rotation by θ can always be undone by a
subsequent rotation by —θ; hence, R-1(θ) = R(-θ).
In addition, noting that all the cosine terms are on the
diagonal and the sine terms are off-diagonal, the
following trigonometric identities can be used
cos(—θ) = cos θ; sin(—θ) = — sin θ to find
R -1(θ)=RT(θ).
These numbers are similar to the unit vectors in 3-D, and q can
be written as:
The magnitude for quaternions can also be defined in the normal manner as
Where 0 = 0i + 0j + 0k
THANK YOU