Graphics Reference
In-Depth Information
Rotate
The World
y
θ y
Rotate
Camera Position
Fixed
Camera Position
Current
Camera Position
Figure 15.7.
Rotating the camera versus rotating the world.
Based on our real-life experience, we know that when taking a photograph we can
either move the camera with respect to the subject or vice versa. Intuitively, as
long as we can achieve proper relative movements, it is possible to take the same
picture by either moving the subject or moving the camera position. Figure 15.7
uses a simple y -rotation of the camera to explain this relative movement. On the
left of Figure 15.7, we see that the camera is rotated about the y -axis by
y .The
right side of Figure 15.7 shows that we would observe the exact same picture if
we rotated the entire world in the opposite direction, in this case by
θ
θ y about the
y -axis.
The above observation says that to properly support camera orbiting, we can
either rotate the camera position according to Equation (15.3), or we can rotate
the entire world in the negative directions relative to the camera. Recall that we
compute the M w 2 e matrix based on the camera parameters and that this matrix is
loaded in the VIEW matrix processor where all geometries are transformed into
the EC. Mathematically, we can implement the rotation of the entire world by
augmenting the M w 2 e matrix,
M r w 2 e
] 1
=[
M or
M w 2 e
R v w
R y
)] 1
=[
( θ
)
( θ
M w 2 e
x
y
R y
( θ y )] 1
R v w
( θ x )] 1 M w 2 e ,
=[
(
or
M r w 2 e =
R y
R v w
( θ y )
( θ x )
M w 2 e .
(15.4)
Here we perform the inverse of the camera orbiting rotations, M 1
or , before the
usual WC-to-EC transform. In this way, all vertices are transformed by the inverse
Search WWH ::




Custom Search