What is z-sorting
Chances are that you have already experienced issues with z-sorting while reading this book or seeing some demos made with Papervision3D. Especially in the previous chapter about modeling, which introduced situations that are bound to cause z-sorting problems. The more complex your model is, the sooner you will experience z-sorting problems.
The following image shows the teapot that was used in Chapter 7 as part of the shading types demo. It clearly shows what the z-sorting issue is about.

Notice that some of the triangles seem to be missing. The missing triangles of the spout are sorted behind triangles of the teapot body. This issue is an artifact of how z-sorting works in Papervision3D .
The painter's algorithm
Z-sorting is the process of determining the depth of each triangle that will be drawn on the screen. It defines the order in which the triangles are drawn on top of each other, based on their distance to the camera. The process of determining which triangle should...