Graphics Programs Reference
In-Depth Information
each point consists of two numbers, three points are enough to reconstruct the trans-
formation matrix. Given three points both before (
P
1
,
P
2
,
P
3
)andafter(
P
1
,
P
2
,
P
3
) a transformation, we can write the three equations
P
1
=
P
1
T
,
P
2
=
P
2
T
,and
P
3
=
P
3
T
and solve for the six elements of
T
.
Example
. Thethreepoints(1
,
1), (1
,
0), and (0
,
1) are transformed to (3
,
4),
1), and (0
,
2), respectively. We write the general transformation (
x
∗
,y
∗
)=(
ax
+
cy
+
m, bx
+
dy
+
n
) for the three sets
(2
,
−
(3
,
4) = (
a
+
c
+
m, b
+
d
+
n
)
,
(2
,
1) = (
a
+
m, b
+
n
)
,
(0
,
2) = (
c
+
m, d
+
n
)
,
−
and this is easily solved to yield
a
=3,
b
=2,
c
=1,
d
=5,
m
=
−
1, and
n
=
−
3. The
transformation matrix is therefore
⎛
⎞
320
150
−
⎝
⎠
.
T
=
1
−
31
Exercise 1.34: Inverse transformations
.From
P
∗
=
PT
,weget
P
∗
T
−
1
=
PTT
−
1
or
P
=
P
∗
T
−
1
. We can therefore reconstruct an original point
P
from the transformed
one,
P
∗
, if we know the inverse of the transformation matrix
T
. In general, the inverse
of the 3
×
3matrix
⎛
⎞
ab
0
cd
0
mn
1
⎝
⎠
T
=
is
⎛
⎞
d
−
b
0
1
T
−
1
=
⎝
⎠
.
−
c
a
0
(1.22)
ad
−
bc
cn
−
dm
bm
−
an
1
Calculate the inverses of the transformation matrices for scaling, shearing, rotation, and
translation, and discuss their properties.
Exercise 1.35:
Given that the four points
P
1
=(0
,
0)
,
P
2
=(0
,
1)
,
P
3
=(1
,
1)
,
and
P
4
=(1
,
0)
are transformed to
P
1
=(0
,
0)
,
P
2
=(2
,
3)
,
P
3
=(8
,
4)
,
and
P
4
=(6
,
1)
,
reconstruct the transformation matrix.
Search WWH ::
Custom Search