Until recently, there was only one application for ray tracing, the modeling and analysis of an optical system. However, today's students have a different application in mind. They think that they are going to be taught how to use powerful computers to generate realistic scenes like those that animation studios use to create movies (see Fig. 1.1).
Both applications, optical system modeling and realistic scene generation, simulate rays traveling through space to create images. Some of these images may be very simple (such as a point or a line), while those in computer-generated images (CGI) are extremely complex.
In the latter case, thousands of rays are traced to build the image of a scene. To reduce the time to compute the scene, only those rays that will reach the eye are traced. The easiest way to do this is to trace the rays in reverse. Starting at an eye, or a camera sensor, a ray is traced from a point on the sensor, through the lens, and out to the scene, where its intersection with the surfaces defined by the computer model of the scene reflect, refract, and scatter the light in the scene.
The CGI procedure is designed to use as few rays as possible so that the images can be rapidly generated. Similarly, system analysis ray tracing tries to use the fewest rays possible to determine how well an optical system, such as that shown in Fig. 1.2, will perform if it were built. In this case, the scene doesn't change. Instead, the same rays are traced through many different variations of an optical system whose dimensions and other variables are changed to find the best performance under specific conditions. This operation is called optimization, and a substantial part of this text describes and demonstrates how it works.