Graphics Reference
In-Depth Information
Fig. 10.7
Perspective view
of the unit cube
and as the
x
-axis of the display screen is in the opposite direction to that of the
frame, we have to switch the sign of the
x
-coordinates:
⎡
⎤
0
1
00
.
5
.
50011
2 2
−
0
.
50
−
0
.
50
−
10
−
⎣
⎦
.
2
2 1111
1 1
1
1 1111
The
x
- and
y
-coordinates are used in Fig.
10.7
to show the perspective view seen
from this translated, rotated frame.
10.6 Rotated Frames of Reference About Arbitrary Axes
In Chap. 9 we developed the following transform to rotate a point
α
about an arbi-
trary axis
n
:
ˆ
⎡
⎤
a
2
K
+
cos
α bK
−
c
sin
αacK
+
b
sin
α
⎣
⎦
2
K
+
R
α,
n
=
abK
+
c
sin
α
cos
α
bcK
−
a
sin
α
2
K
acK
−
b
sin
αbcK
+
a
sin
α
+
cos
α
K
=
1
−
cos
α
c
k
.
Therefore, there is nothing to stop us using the same transform to rotate a frame
n
ˆ
=
a
i
+
b
j
+
−
α
n
, or its inverse
R
−
1
α,
ˆ
about
n
. To compute the latter, we
simply transpose the matrix, or change the sign of
α
which implies reversing the
sign of the sine terms:
ˆ
to rotate a frame
α
about
ˆ
n
⎡
⎤
a
2
K
+
cos
α bK
+
c
sin
αacK
−
b
sin
α
R
−
1
α,
⎣
⎦
.
2
K
n
=
abK
−
c
sin
α
+
cos
α
bcK
+
a
sin
α
(10.5)
ˆ
2
K
+
acK
+
b
sin
α
bcK
−
a
sin
α
cos
α
Let's test (
10.5
) using the previous example where we rotated a frame 270° about
the
y
-axis, which makes
α
=
270°,
n
ˆ
=
j
and
K
=
1:
⎡
⎤
001
010
−
R
−
1
⎣
⎦
270
°
,
j
=
100