Graphics Reference
In-Depth Information
7.6.1 Positioning the Virtual Camera
Four coordinate systems are used in the computer graphics pipeline: object
space , world space , camera space and image space .
The object space is a domain where objects are modelled and assembled.
The world space is where objects are positioned and animated through
appropriate transforms. The world space also hosts a virtual camera or
observer.
The camera space is a transform of the world space to the camera's point
of view.
Finally, the image space is a projection - normally perspective - of the
camera space onto an image plane.
The transforms considered so far are used to manipulate and position ob-
jects within the world space. What we will consider next is how a virtual
camera or observer is positioned in world space, and the process of convert-
ing world coordinates to camera coordinates. The procedure used generally
depends on the method employed to define the camera's frame of reference
within the world space, which may involve the use of direction cosines, Euler
angles or quaternions. We will examine how each of these techniques could be
implemented.
7.6.2 Direction Cosines
A 3D unit vector has three components [ xyz ] T , which are equal to the cosines
of the angles formed between the vector and the three orthogonal axes. These
angles are known as direction cosines and can be computed taking the dot
product of the vector and the Cartesian unit vectors. Figure 7.19 shows the
direction cosines and the angles. These direction cosines enable any point P ( x ,
y , z ) in one frame of reference to be transformed into P ( x ,y ,z ) in another
frame of reference as follows:
·
x
y
z
1
r 11 r 12 r 13 0
r 21 r 22 r 23 0
r 31 r 32 r 33 0
0001
x
y
z
1
=
(7.76)
where: r 11 ,r 12 ,r 13 are the direction cosines of the secondary x -axis
r 21 ,r 22 ,r 23 are the direction cosines of the secondary y -axis
r 31 ,r 32 ,r 33 are the direction cosines of the secondary z -axis.
To illustrate this operation, consider the situation shown in Figure 7.20
which shows two axial systems mutually aligned. Evaluating the direction
cosines results in the following matrix transformation:
x
y
z
1
1000
0100
0010
0001
x
y
z
1
·
=
Search WWH ::




Custom Search