Graphics Reference
In-Depth Information
There's a third reason, however: It'll soon become apparent that we can also
work with triples whose third entry is neither 1 nor 0, and use the operation
of homogenization (dividing by w ) to convert these to points (i.e., triples with
w = 1), except when w = 0. This allows us to study even more transformations,
one of which is central to the study of perspective, as we'll see later.
The singular value decomposition provides the tool necessary to decompose
not just linear transformations, but affine ones as well (i.e., combinations of linear
transformations and translations).
10.7 Windowing Transformations
( u 2 , v 2 )
v
As an application of our new, richer set of transformations, let's examine window-
ing transformations, which send one axis-aligned rectangle to another, as shown
in Figure 10.13. (We already discussed this briefly in Chapter 3.)
We'll first take a direct approach involving a little algebra. We'll then examine
a more automated approach.
We'll need to do essentially the same thing to the first and second coordinates,
so let's look at how to transform the first coordinate only. We need to send u 1 to
x 1 and u 2 to x 2 . That means we need to scale up any coordinate difference by the
factor
( u 1 , v 1 )
( u 2 , v 1 )
u
x 2
x 1
u 2 u 1 . So our transformation for the first coordinate has the form
y
x 2
x 1
t
u 1 t + something.
(10.63)
u 2
( x 2 , y 2 )
If we apply this to t = u 1 , we know that we want to get x 1 ; this leads to the
equation
x
x 2
x 1
( x 1 , y 1 )
( x 2 , y 1 )
u 1 u 1 + something = x 1 .
(10.64)
u 2
Solving for the missing offset gives
Figure 10.13: Window transfor-
mation
x 2
x 1
u 1 u 1 = x 1 u 2
u 1
x 2
x 1
x 1
u 1
u 1 u 1
(10.65)
setup.
We need to move
u 2
u 2
u 2
the
uv-rectangle
to
the
xy-
= x 1 u 2
x 1 u 1
x 2 u 1 + x 1 u 1
rectangle.
(10.66)
u 2
u 1
= x 1 u 2
x 2 u 1
,
(10.67)
u 2
u 1
so that the transformation is
x 2
x 1
u 1 t + x 1 u 2
x 2 u 1
t
.
(10.68)
u 2
u 2
u 1
Doing essentially the same thing for the v and y terms (i.e., the second coordi-
nate) we get the transformation, which we can write in matrix form:
T ( x )= Mx ,
(10.69)
where
.
x 1
u 2 u 1
x 2
x 1 u 2
x 2 u 1
u 2 u 1
0
y 2 y 1
v 2 v 1
y 1 v 2 y 2 v 1
v 2 v 1
M =
0
(10.70)
0
0
1
 
 
Search WWH ::




Custom Search