Graphics Programs Reference
In-Depth Information
An improper rotation differs from a rotation in one important aspect. When we
rotate an object through a small angle and repeat this transformation, the object seems
to move smoothly along a circle. Each time we repeat an improper rotation, however,
the object “jumps” from one side of the coordinate plane to the other. The total effect
is very different from that of a smooth circular movement.
1.2.9 Decomposing Transformations
Sometimes, a certain transformation
A
may be equivalent to the combined effects of
several different transformations
B
,
C
,and
D
.Wesaythat
A
can be
decomposed
into
B
,
C
,and
D
. Mathematically, this is equivalent to saying that the original transformation
matrix
T
A
equals the product
T
B
T
C
T
D
. We have already seen that a rotation in two
dimensions can be decomposed into a scaling followed by a shearing; here are other
examples.
It may come as a surprise that the general two-dimensional transformation matrix,
Equation (1.7), can be written as a product of shearing, scaling, rotation, and translation
as follows:
⎡
⎤
ab
0
cd
0
mn
1
⎣
⎦
=
⎡
⎤
⎡
⎤
⎡
⎤
⎡
⎤
1
0
0
A
0
0
a/A
b/A
0
100
010
mn
1
⎣
⎦
⎣
⎦
⎣
⎦
⎣
⎦
,
(
ac
+
bd
)
/A
2
10
0
ad
−
bc
)
/A
0
−
b/A
a/A
0
0
0
1
0
0
1
0
0
1
(1.21)
where
A
=
√
a
2
+
b
2
. The third matrix produces rotation since (
a/A
)
2
+(
b/A
)
2
=1.
Even something as simple as shearing in one direction can be written as the product
of a unit shearing and two scalings:
⎛
⎞
⎛
⎞
⎛
⎞
⎛
⎞
100
c
10
001
1
/c
00
010
001
100
110
001
c
00
010
001
⎝
⎠
=
⎝
⎠
⎝
⎠
⎝
⎠
.
Even the simple transformation of a unit shearing can be decomposed into a product
that involves a scaling and two rotations. Note that the Golden Ratio
φ
is involved,
⎛
⎞
⎛
⎞
⎛
⎞
⎛
⎞
100
110
001
cos
α
−
sin
α
0
φ
00
0
/φ
0
001
cos
β
sin
β
0
⎝
⎠
=
⎝
⎠
⎝
⎠
⎝
⎠
,
sin
α
cos
α
0
−
sin
β
cos
β
0
0
0
1
0
0
1
where
α
=tan
−
1
φ
58
.
28
◦
and
β
=tan
−
1
(1
/φ
)
31
.
72
◦
.
(This is indeed a surprising result. It means that a clockwise rotation of 58
.
28
◦
,
followed by a scaling of
φ
in the
x
direction and 1
/φ
in the
y
direction, followed by
a counterclockwise rotation of 31
.
72
◦
, is equivalent to a unit shear in the
x
direction.
This is illustrated by Figure 1.17.)
≈
≈
Search WWH ::
Custom Search