Graphics Reference
In-Depth Information
Virtual
frame
buffer
y
y
Ray constructed
through pixel
center
x
x
z
Object
Space
World
Space
z
Screen Space
FIGURE 2.5
Transformation through spaces using ray casting.
Typically, when transforming a point in world space, the fourth component will be one. This means a
point in space has a very simple homogeneous representation (Eq. 2.4) .
ðx; y; zÞ½x; y; z;
1
(2.4)
The basic transformations of rotate, translate, and scale can be kept in 4
4 transformation matrices.
The 4
4 matrix is the smallest matrix that can represent all of the basic transformations. Because it is a
square matrix, it has the potential for having a computable inverse, which is important for texture map-
ping and illumination calculations. In the case of rotation, translation, and nonzero scale transforma-
tions, the matrix always has a computable inverse. It can be multiplied with other transformation
matrices to produce compound transformations while still maintaining 4 4-ness. The 4 4 identity
matrix has zeros everywhere except along its diagonal; the diagonal elements all equal one (Eq. 2.5) .
2
3
2
3
2
3
x
y
1
1000
0100
0010
0001
x
y
1
4
5 ¼
4
5
4
5
(2.5)
Typically in the literature, a point is represented as a 4
1 column matrix (also known as a column
vector ) and is transformed by multiplying by a 4
4 matrix on the left (also known as premultiplying
the column vector by the matrix), as shown in Equation 2.5 in the case of the identity matrix. However,
some texts use a 1
4 matrix (also known as a row vector ) to represent a point and transform it by
multiplying it by a matrix on its right (the matrix postmultiplies the row vector). For example,
postmultiplying a point by the identity transformation would appear as in Equation 2.6 .
2
4
3
5
1000
0100
0010
0001
½xyz 1
¼½xyz 1
(2.6)
 
Search WWH ::




Custom Search