Graphics Reference
In-Depth Information
the matrix transformation is
·
x
y
z
0
10
x
y
z
=
100
00
1
Substituting (1, 1, 1) for ( x , y , z ) the rotated point becomes (
1 ,
1 ,
1), as
shown in Figure 7.28.
7.7.8 Frames of Reference
A quaternion, or its equivalent matrix, can be used to rotate a vertex or
position a virtual camera. If unit quaternions are used, the associated matrix
is orthogonal, which means that its transpose is equivalent to rotating the
frame of reference in the opposite direction. For example, if the virtual camera
is oriented with a yaw rotation of 180 , i.e. looking along the negative z -axis,
the orientation quaternion is [0, [0, 1, 0]]. Therefore s =0 ,x =0 ,y =1 ,z =0.
The equivalent matrix is
10 0
01 0
00
1
which is equal to its transpose. Therefore, a vertex ( x , y , z ) in world space has
coordinates ( x ,y ,z ) in camera space and the transform is defined by
x
y
z
10 0
01 0
00
x
y
z
=
·
1
If the vertex ( x , y , z ) is (1, 1, 0), ( x ,y ,z ) becomes (
1 , 1 , 0), which is correct.
However, it is unlikely that the virtual camera will only be subjected to a sim-
ple rotation, as it will normally be translated from the origin. Consequently,
a translation matrix will have to be introduced as described above.
7.8 Transforming Vectors
The transforms described in this chapter have been used to transform single
points. However, a geometric database will contain not only pure vertices,
but also vectors, which must also be subject to any prevailing transform.
A generic transform Q of a 3D point can be represented by
x
y
z
1
x
y
z
1
=[ Q ]
·
(7.103)
Search WWH ::




Custom Search