Graphics Reference
In-Depth Information
we can relate this to our real-world experience using a camera with no zoom-
ing capability—we can only move the camera and/or change the position we are
looking at. If we think back to our experience using a (video) camera, unless we
have special-purpose equipment, we actually seldom move both the camera and
the look-at positions simultaneously. Typically, we look through the camera and
keep one of the two positions relatively stationary.
1.
Constant camera position.
This is like standing at a fixed position and
aiming the camera around. We can pan the environment, search for a sub-
ject, or follow a moving subject.
2.
Constant look-at position.
This typically happens when we are examining
a subject, where we can move the camera closer/farther from the subject
(fixed position), or orbit the camera around the subject.
Of course, we are discussing computer graphics, and we do not need to be con-
strained by the physical world. For example, we can place a camera and aim it at
any position in the scene. In the next chapter, after we re-examine OC space and
the involved transformations, we will learn how to place a camera on a moving
object and aim at arbitrary positions in our world.
For clarity, we only discuss the changing of camera position with the look-at
position kept, in most cases, stationary. The mathematics presented applies to
the alternative scenario, where the camera position is kept stationary with chang-
ing look-at position. The implementation of the alternative scenario is left as an
exercise.
For the following discussion, we will assume the symbols and results from
Section 14.3, where
Eye (camera) position:
p
e
=(
x
e
,
y
e
,
z
e
)
,
Look at position:
p
a
=(
x
a
,
y
z
,
z
a
)
,
User specified up vector:
V
up
,
View vector:
V
v
=
p
a
−
p
e
,
View distance:
distance from
p
e
to
p
a
=
v
d
=
V
v
,
and the EC orthonormal basis is (Equation (14.3)):
⎨
V
w
=(
x
w
,
y
w
,
z
w
)
,
V
u
=(
EC orthonormal basis:
x
u
,
y
u
,
z
u
)
,
⎩
V
v
=(
x
v
,
y
v
,
z
v
)
,
Search WWH ::
Custom Search