Graphics Reference
In-Depth Information
Fig. 10.6
(
a
) The translated frame. (
b
) The rotated frame about the
y
-axis
Using the unit cube, let's position the new frame 2 units along the initial
x
-axis,
and then rotate the frame 270° about its local
y
-axis so that its
z
-axis is looking
back towards the original origin. Figure
10.6
(a) shows the translated frame, and
Fig.
10.6
(b) shows the rotated frame. Thus
t
x
=
2,
t
y
=
t
z
=
0,
α
=
0°,
β
=
270°
and
γ
=
0°. Substituting these values in (
10.2
)wehave
⎡
⎣
⎤
⎦
⎡
⎣
⎤
⎦
0 010
0 100
−
100
2
010 0
001 0
000 1
−
R
−
1
0
°
,z
R
−
1
270
°
,y
R
−
1
0
°
,x
T
−
1
2
,
0
,
0
=
(10.3)
1000
0 001
⎡
⎣
⎤
⎦
0 010
0 100
−
=
.
(10.4)
1002
0 001
Using (
10.4
) to process the coordinates of the unit cube we have
⎡
⎤
⎡
⎤
0 010
0 100
−
00001111
00110011
01010101
11111111
⎣
⎦
⎣
⎦
1002
0 001
⎡
⎤
01010101
00110011
22221111
11111111
⎣
⎦
=
which are confirmed by Fig.
10.6
(b).
To obtain a perspective view of the cube we simply divide its transformed
x
- and
y
-coordinates by the associated
z
-coordinate:
⎡
⎣
⎤
⎦
00
.
50
.
50101
00
.
50
.
50011
2 2
2
2 1111
1 1
1
1 1111