Graphics Reference
In-Depth Information
1
1
100
0
100
0
0.96
0.26
0
10
001
10
001
0.26
0.96
0
0
0
1
100
0
1.7 0 0
0 .70
001
0
9
1
.
·
10
001
(10.94)
We subtract from this the coordinates, ( 0, 9 ) , of the tip of the minute hand (in the
minute-hand coordinate system) to get a vector from the tip of the minute hand to
the tip of the hour hand.
As a final exercise, suppose we wanted to create an animation of the clock in
which someone has grabbed the minute hand and held it so that the rest of the
clock spins around the minute hand. How could we do this?
Well, the reason the minute hand moves from its initial 12:00 position on the
Canvas (i.e., its position after it has been rotated 180 the first time) is that a
sequence of further transformations have been applied to it. This sequence is rather
short: It's just the varying rotation. If we apply the inverse of this varying rotation
to each of the clock elements, we'll get the desired result. Because we apply both
the rotation and its inverse to the minute hand, we could delete both, but the struc-
ture is more readable if we retain them. We could also apply the inverse rotation
as part of the Canvas 's render transform.
Inline Exercise 10.23: If we want to implement the second approach—
inserting the inverse rotation in the Canvas 's render transform—should it
appear (in the WPF code) before or after the scale-and-translate transforms
that are already there? Try it!
10.12 Transforming Vectors and Covectors
E 2
We've agreed to say that the point ( x , y )
corresponds to the 3-space
vector xy 1 T , and that the vector u
v
corresponds to the 3-space vector
uv 0 T .Ifweusea3
3matrix M (with last row 001 ) to transform
×
3-space via
T : R 3
R 3 : x
Mx ,
(10.95)
then the restriction of T to the w = 1 plane has its image in E 2 as well, so we can
write
E 2 ): E 2
E 2 : x
( T
|
Mx .
(10.96)
But we also noted above that we could regard T as transforming vectors, or
displacements of two-dimensional Euclidean space, which are typically written
with two coordinates but which we represent in the form uv 0 T . Because
the last entry of such a “vector” is always 0, the last column of M has no effect on
how vectors are transformed. Instead of computing
 
 
 
Search WWH ::




Custom Search