Basic Ray Tracing Algorithm - Polygon Rendering
The Hidden-surface removal is the most complete and most versatile method for display of objects in a realistic fashion. The concept is simply to take one ray at a time, emanating from the viewer's eye (in perspective projection) or from the bundle of parallel lines of sight (in parallel projection) and reaching out to each and every pixel in the viewport, using the laws of optics.
Generally, to avoid wastage of effort by rays starting from sources of light going out of the viewport, the reverse procedure of starting with ray from the viewpoint and traveling to each pixel in the viewport is adopted. If the ray encounters one or more objects, the algorithm filters out all but the nearest object, or when there is an overlap or a hole, the nearest visible portion of all the objects along the line of sight.