Graphics Reference
In-Depth Information
In a similar fashion, there is not a camera object in computer graphics. For
example, in the source code of Tutorial 13.1, there is no camera object, and yet
the image of Figure 13.7 clearly presents the results of a camera taking a picture.
In this case, the functionality of the camera is realized in Step 2 of Listing 13.2,
in the definition of the VIEW and PROJECTION matrix processors. This is true in
general that the functionality of a camera is implemented by a few lines of code
that compute and load the two matrix processors. However, just as in the case of
primitives, we will refer to an abstract camera when discussing the involved func-
tionality. In this way, we can begin analyzing the 3D computer graphics imaging
process by referring to our existing experience working with real cameras.
In the real world, after arranging a camera, we count on the physical laws of
optics and the chemical processes on the film (or optical properties of the charge-
coupled device) to complete the photographic image-capturing process. In com-
puter graphics, we have to algorithmically simulate the laws of physics and the
imaging process to convert geometric representation of objects into pixels of an
image. This process is referred to as rendering, where geometric objects are ren-
dered into pixels in an image. In this chapter, we learn about the camera and the
coordinate transformations of the rendering process. We will continue to refer to
the simple 3D scene of Tutorial 13.1 and Figure 13.6 to learn about the details of
the mathematics and matrix setups.
14.1 A Computer Graphics Camera
Based on our everyday experience, we know that when taking a photograph, we
must consider the following.
Camera position . Where to place the camera.
Look-at position . Where to aim the camera.
Up direction . Whether to rotate the camera for portrait or landscape pho-
tographs.
These parameters translate directly to a computer graphics camera.
Camera position. This is the location of the camera. In typical computer graph-
ics applications, we work with pinhole cameras, where all objects in the resulting
image are in focus. In this case, the camera position is actually the location of the
pinhole. Figure 14.1 shows that in Tutorial 13.1, the camera is located at (0 cm,
10 cm,
25 cm).
Search WWH ::




Custom Search