Graphics Reference
In-Depth Information
geometric face of Figure 10.11, we know
DC coordinate:
0
≤
x
dc
≤
300
,
0
≤
y
dc
≤
300
,
whereas
WC window:
15
≤
x
wc
≤
25
,
.
In this case, the user's mouse clicks (
pt
dc
) will return points in DC space with
range
25
≤
y
wc
≤
35
. Clearly, this is very different from where the features of the face
are defined in the WC space. In this case, we must perform the inverse of the
M
w
2
d
operator to transform
pt
dc
into a point in WC space. If we express
pt
dc
=(
[
0
,
300
]
x
dc
,
y
dc
)
as a vector
V
dc
=
x
dc
y
dc
,
then we must compute
V
wc
,where
V
wc
=
V
dc
M
−
1
w
2
d
.
From Equation (10.14), recall that
M
w
2
d
is
W
dc
W
wc
,
H
dc
H
wc
)
W
dc
2
H
dc
2
M
w
2
d
=
(
−
,−
)
(
(
,
)
.
(
.
)
T
cx
wc
cy
wc
S
T
10
14
From the discussion in Section 9.2, we know that the inverse of a concatenated
operator is simply the inverse of each element concatenated in the reverse order:
Inverse transforms.
T
−
1
W
dc
2
H
dc
2
)
W
dc
W
wc
,
H
dc
H
wc
)
M
−
1
T
−
1
S
−
1
T
−
1
w
2
d
=
M
d
2
w
=
(
,
(
(
−
cx
wc
,−
cy
wc
)
,
(
t
x
,
t
y
)=
T
(
−
t
x
,−
t
y
)
S
−
1
1
s
x
,
1
s
y
)
(
s
x
,
s
y
)=
S
(
which is
W
dc
2
H
dc
2
W
wc
W
dc
,
H
wc
H
dc
)
M
d
2
w
=
T
(
−
,−
)
S
(
T
(
cx
wc
,
cy
wc
)
(10.17)
or
W
dc
2
H
dc
2
)
W
wc
W
dc
,
H
wc
H
dc
)
V
wc
=
V
dc
T
(
−
,−
S
(
T
(
cx
wc
,
cy
wc
)
.
(10.18)
Equation (10.18) says that to transform a point
(
x
dc
,
y
dc
)
from the device drawing
area (DC) to a point
(
x
wc
,
y
wc
)
in our design space (WC):
W
dc
2
W
wc
x
wc
=((
x
dc
−
)
W
dc
)+
cx
wc
,
(10.19)
H
dc
2
H
wc
y
wc
=((
y
dc
−
)
H
dc
)+
cy
wc
,
where
Device drawing area
width
=
W
dc
,
=
H
dc
,
height
Search WWH ::
Custom Search