The Z-buffer or depth memory is one of the most common methods for solving the problem of an objects' visibility in a scene. It has relatively large memory demands because in displaying objects it will keep their z-coordinates in a special two-dimensional field with the dimensions of a table (mostly a display box), where there are stored the coordinates of calculated points. At the beginning, this field is filled in with a maximum value (e.g., maximum z-value of all objects in the display box).
In displaying in a display box we proceed so that we transfer every object into a raster form. In this way, we obtain points with the coordinates x, y a z. Because the display box is only two-dimensional, the objects which are overlapped should not be visible. The Z-buffer serves also to avoid the situation where more distant objects are drawn last and in this way overlap objects standing closer to the observer.
We put into the field all z-coordinates of the relevant points of the given objects. I f during the test of a new point we found out that in the field there is a different value than the starting, then, providing the new value is lower, we write it in.
ALGORITHM:
The order of processed polygons can be any, with every surface being processed only once. This method is hardware implemented in all 3D cards (depth of 16, 24, or 32 bits).
A disadvantage of the Z-buffer is its memory demand. The line scanning algorithm reduces memory demands of storage as here it is necessary to store only a field equal to one horizontal line of the screen. This method is based on the decomposition of a polygon into raster form. Here, however, it is necessary to carry out the raster decomposition several times. For each row of the display box we test every surface in a scene, using the given field as a depth memory. An example of the algorithm as described is in [1].
This algorithm is based on the idea of the consecutive drawing of all surfaces, from the most distant up to the polygons located close to the table; similarly, as a painter over lays gradually individual layers of surfaces. The surface drawn later will overlap the surface below it. The visibility solution is then carried out through the arrangement of surfaces based on the distance of the observer. Because the surfaces are 3D objects, it is not possible to arrange definitely according to the distances. Therefore, we proceed as follows: firstly, we arrange, meaning the indexing of surfaces according to the lowest z-coordinate of the relevant surface. This series cannot be drawn directly because there can appear a case when a surface with a lower z-coordinate would overlap another surface with a larger z-coordinate. The painter algorithm is suitable for more simple scenes with limited conjunctions of objects, due to its low calculation and memory demands.
After indexing all surfaces, we can start the method of drawing itself. Firstly, the surface from a list is marked as active, and then, we test it with regard to overlapping with other surfaces.
In 1969 Warnock designed an algorithm for display subdivision (therefore the Warnock subdivision algorithm). The main idea is vested in the fact that the issue of visibility should be resolved in the display box outright. If it is not possible, then we try to solve it recursive in a smaller window box (where the original box is divided into four new boxes). The algorithm is recursive repeated.
Special displaying method on drawing spatial graphs, where visibility is determined by the floating horizon method. The algorithm uses two auxiliary fields (the upper horizon HOR, and the bottom horizon DOL) with the dimensions equal to the number of pixels of the table in the horizontal direction.
ALGORITHM: