Game Development Reference
In-Depth Information
Nearly all 3D games use a perspective projection to render their scene. Like the real
world, this simulates the application of a perspective to objects rendered within the
game so that objects that are further away appear smaller than objects that are nearer.
In addition to this obvious size effect, more subtle effects of perspective are picked
up intuitively by us, and we will add a substantial feeling of depth to the rendered
scene. The sides of a cube would seem to narrow slightly as the distance from the
viewer increases, thereby allowing us to automatically determine the exact position
in which the cube is situated.
Understanding the viewing frustum
The viewing volume of a camera takes the shape of a frustum which is a rectangular
cone with its tip cut off, as shown in the following figure:
Far clip plane
Near clip plane
Camera
Objects that fall inside the volume of the frustum are visible through the camera.
Objects that fall outside the view volume are hidden.
The near and far clip planes decide the visibility of the object. Objects nearer to the
camera than the near clip plane and the objects further than the far clip plane are
excluded from rendering. In addition to the clip planes, the frustum is defined by the
viewing angle and the aspect ratio. The viewing angle defines the angle, in degrees,
between the camera and the y axis.
Changing the angle will cause the overall shape of the frustum to expand or compress,
thereby causing apparent changes in the size of objects.
 
Search WWH ::




Custom Search