CSharp  Java  Python  Swift  GO  WPF  Ruby  Scala  F#  JavaScript  SQL  PHP  Angular  HTML
Painter AlgorithmIt came under the category of list priority algorithm. It is also called a depthsort algorithm. In this algorithm ordering of visibility of an object is done. If objects are reversed in a particular order, then correct picture results. Objects are arranged in increasing order to z coordinate. Rendering is done in order of z coordinate. Further objects will obscure near one. Pixels of rear one will overwrite pixels of farther objects. If z values of two overlap, we can determine the correct order from Z value as shown in fig (a). If z objects overlap each other as in fig (b) this correct order can be maintained by splitting of objects. Depth sort algorithm or painter algorithm was developed by Newell, sancha. It is called the painter algorithm because the painting of frame buffer is done in decreasing order of distance. The distance is from view plane. The polygons at more distance are painted firstly. The concept has taken color from a painter or artist. When the painter makes a painting, first of all, he will paint the entire canvas with the background color. Then more distance objects like mountains, trees are added. Then rear or foreground objects are added to picture. Similar approach we will use. We will sort surfaces according to z values. The z values are stored in the refresh buffer. Steps performed indepth sort
Painter AlgorithmStep1: Start Algorithm Step2: Sort all polygons by z value keep the largest value of z first. Step3: Scan converts polygons in this order.
The success of any test with single overlapping polygon allows F to be painted.
Next TopicScan Line Algorithm
