Page 207 - DCAP504_Computer Graphics
P. 207
Computer Graphics
The following figure 13.9 depicts the setup for ray tracing and is explained by considering the analogy
of a camera, an eye and the view window.
Figure 13.9: Ray Tracing
In graphics, the viewpoint is called the eye or the camera. A camera requires a film on which the scene
will be projected. In graphics, the scene is drawn on the view window. In a camera the film is placed
behind the aperture or focal point while in graphics the view window lies in front of the focal point.
The light ray causes a color of each point on real film when passing through the aperture and hits the
aperture. In computer graphics, a simulated light ray causes each pixel of the final image to hit the view
window on its path towards the eye. The main intention is to find the color of each point which lies on
the view window. The view window is divided into many small squares. Each of these squares
corresponds to one pixel in the final image.
When you intend to create an image with resolution of 640x400 then the view window
would be divided into a grid of 640 squares across and 400 square down. The
challenging task lies in assigning a color to each of these squares and this is done by ray
tracing
Let us now discuss about the working principle of ray tracing.
Ray tracing adapts the simulated path taken by the light rays that travel both forwards and backwards.
The main goal is to determine the color of each light ray which hits the view window before reaching
the eye.
Ray tracing starts from the origin of light source and travels to its destination .i.e. to the eye as shown in
figure 13.10. When you consider tracing one ray with one light and one object such as a ball then you
start from the light bulb and shoot the number of rays required from the bulb. The direction of each ray
is decided. It was found that rays traveled in different directions some of them hit directly and others
bounced back to reach the eye while the rest never reached the eye. A considerable amount of time was
wasted during this course.
200 LOVELY PROFESSIONAL UNIVERSITY