i
i
i
i
i
i
i
i
6 1. Introduction
where i denotes the row and j the column, as in Equation 1.2:
M =
m
00
m
01
m
02
m
10
m
11
m
12
m
20
m
21
m
22
. (1.2)
The following notation, shown in Equation 1.3 for a 3×3matrix,isusedto
isolate vectors from the matrix M: m
,j
represents the jth column vector
and m
i,
represents the ith row vector (in column vector form). As with
vectors and points, indexing the column vectors can also be done with x,
y, z, and sometimes w, if that is more convenient:
M =
m
,0
m
,1
m
,2
=
m
x
m
y
m
z
=
m
T
0,
m
T
1,
m
T
2,
. (1.3)
A plane is denoted π : n · x + d = 0 and contains its mathematical
formula, the plane normal n and the scalar d. The normal is a vector
describing what direction the plane faces. More generally (e.g., for curved
surfaces), a normal describes this direction for a particular point on the
surface. For a plane the same normal happens to apply to all its points.
π is the common mathematical notation for a plane. The plane π is said
to divide the space into a positive half-space,wheren · x + d>0, and a
negative half-space,wheren · x + d<0. All other points are said to lie in
the plane.
A triangle can be defined by three points v
0
, v
1
,andv
2
and is denoted
by v
0
v
1
v
2
Table 1.2 presents a few additional mathematical operators and their
notation. The dot, cross, determinant, and length operators are covered
in Appendix A. The transpose operator turns a column vector into a row
vector and vice versa. Thus a column vector can be written in compressed
form in a block of text as v =(v
x
v
y
v
z
)
T
. Operator 4 requires further
explanation: u v denotes the vector (u
x
v
x
u
y
v
y
u
z
v
z
)
T
, i.e., component
i of vector u and component i of vector v are multiplied and stored in
component i of a new vector. In this text, this operator is used exclusively
for color vector manipulations. Operator 5, introduced in Graphics Gems
IV [551], is a unary operator on a two-dimensional vector. Letting this
operator work on a vector v =(v
x
v
y
)
T
gives a vector that is perpendicular
to v, i.e., v
=(v
y
v
x
)
T
.Weuse|a| to denote the absolute value of the
scalar a, while |A| means the determinant of the matrix A. Sometimes,
we also use |A| = |abc| =det(a, b, c), where a, b,andc are column
vectors of the matrix A. The ninth operator, factorial, is defined as shown
i
i
i
i
i
i
i
i
1.2. Notation and Definitions 7
Operator Description
1: · dot product
2: × cross product
3: v
T
transpose of the vector v
4: piecewise vector multiplication
5:
the unary, perp dot product operator
6: |·| determinant of a matrix
7: |·| absolute value of a scalar
8: ||·|| length (or norm) of argument
9: n! factorial
10:
n
k
binomial coefficients
Table 1.2. Notation for some mathematical operators.
below, and note that 0! = 1:
n!=n(n 1)(n 2) ···3 · 2 ·1. (1.4)
The tenth operator, the binomial factor, is defined as shown in Equa-
tion 1.5:
n
k
=
n!
k!(n k)!
. (1.5)
Further on, we call the common planes x =0,y =0,andz =0
the coordinate planes or axis-aligned planes.Theaxese
x
=(1 0 0)
T
,
e
y
=(0 1 0)
T
,ande
z
=(0 0 1)
T
are called main axes or main directions
and often the x-axis, y-axis, and z-axis. This set of axes is often called
the standard basis. Unless otherwise noted, we will use orthonormal bases
(consisting of mutually perpendicular unit vectors; see Appendix A.3.1).
The notation for a range that includes both a and b, and all numbers in
between is [a, b]. If you want all number between a and b, but not a and b
themselves, then we write (a, b). Combinations of these can also be made,
e.g., [a, b) means all numbers between a and b including a but not b.
The C-math function atan2(y,x) isoftenusedinthistext,andso
deserves some attention. It is an extension of the mathematical function
arctan(x). The main differences between them are that
π
2
< arctan(x) <
π
2
,that0 atan2(y, x) < 2π, and that an extra argument has been added
to the latter function. This extra argument avoids division by zero, i.e.,
x = y/x except when x =0.
i
i
i
i
i
i
i
i
8 1. Introduction
Function Description
1: atan2(y, x) two-value arctangent
2: cos(θ) clamped cosine
3: log(n) natural logarithm of n
Table 1.3. Notation for some specialized mathematical functions.
Clamped-cosine, cos(θ), is a function we introduce in order to keep
shading equations from becoming difficult to read. If the result of the
cosine function is less than zero, the value returned by clamped-cosine is
zero.
In this volume the notation log(n) always means the natural logarithm,
log
e
(n), not the base-10 logarithm, log
10
(n).
We use a right-hand coordinate system (see Appendix A.2) since this
is the standard system for three-dimensional geometry in the field of com-
puter graphics.
Colors are represented by a three-element vector, such as (red, green,
blue), where each element has the range [0, 1].
1.2.2 Geometrical Definitions
The basic rendering primitives (also called drawing primitives) used by
most graphics hardware are points, lines, and triangles.
1
Throughout this book, we will refer to a collection of geometric entities
as either a model or an object.Ascene is a collection of models comprising
everything that is included in the environment to be rendered. A scene can
also include material descriptions, lighting, and viewing specifications.
Examples of objects are a car, a building, and even a line. In practice, an
object often consists of a set of drawing primitives, but this may not always
be the case; an object may have a higher kind of geometrical representation,
such as ezier curves or surfaces, subdivision surfaces, etc. Also, objects
can consist of other objects, e.g., we call a car model’s door an object or a
subset of the car.
Further Reading and Resources
The most important resource we can refer you to is the website for this
book: http://www.realtimerendering.com. It contains links to the latest
information and websites relevant to each chapter. The field of real-time
rendering is changing with real-time speed. In the book we have attempted
1
The only exceptions we know of are Pixel-Planes [368], which could draw spheres,
and the NVIDIA NV1 chip, which could draw ellipsoids.
i
i
i
i
i
i
i
i
1.2. Notation and Definitions 9
to focus on concepts that are fundamental and techniques that are unlikely
to go out of style. On the website we have the opportunity to present
information that is relevant to today’s software developer, and we have the
ability to keep up-to-date.
i
i
i
i
i
i
i
i
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset