Page 168 - DCAP504_Computer Graphics
P. 168
Unit 11: Hidden Surfaces
(d) If the surrounding polygon is the closest to the sample area then draw -
The polygon along with its color value.
(e) If the area under consideration is a pixel –
Compute the z value of all the polygons in the polygon visible list.
Set the color of the polygon possessing optimum z value.
5. If no condition in step 3 is true, then subdivide the area into four equal parts.
6. Repeat steps 2 and 3 for each area.
11.5 Ray Tracing vs. Rasterization
It is important to understand the differences between ray tracing and rasterization when studying
hidden surfaces.
Ray Tracing
Ray tracing algorithm provides the flexibility to handle both flat and curved surfaces. This algorithm
can be easily modified to provide realistic shading. It is based on the principles of light and optics. Let
us assume opaque surfaces of given colors and deal directly with perspective projection transformation
without applying perspective to parallel transformation.
The basic idea here is to trace light rays and determine which one arrives back at the eye or viewpoint.
This involves an infinite number of light rays. Hence, we trace a ray from the viewpoint through a pixel
until it reaches a surface. This identifies the first surface seen at the given pixel. Set this pixel to the color
of the surface at the point where the light ray strikes it.
Figure 11.1: Ray Tracing Phenomenon
Each ray is tested for intersection with each object in the picture including the non-clipping plane. Since
each ray can intersect many objects, we find the intersection point ‘P’ is closest to the viewpoint. Set the
pixel belonging to the given ray to the color of the surface on which this point ‘P’ lies. This becomes the
first surface intersected by the ray. Repeat this process for every pixel. There is no need to check for
intersections with enclosed surface if a ray does not intersect a bounding box. The most important
reason for using ray-tracing method is to create realistic renderings of pictures with the help of laws of
optics for reflecting and transmitting light rays.
LOVELY PROFESSIONAL UNIVERSITY 161