From: Gary B. <gb...@cs...> - 2002-06-24 18:14:44
|
Hi, Alan asked me to follow up to the list with a brief description of what I did to fix the "missing triangles bug" in plotsh3d. The old code attempted to modify the hidden-line algorithm to do hidden surfaces. This is very difficult. Hidden-line algorithms are much more complicated than hidden-surface algorithms. So much so that the modern way to do hidden lines is with a hidden-surface algorithm that draws polygons that have their edges shaded and their middles background colored. I didn't want to fool with the hidden-line algorithm so I wrote a completely separate algorithm for doing the hidden surface removal. I'm using a simple back-to-front ("painters") algorithm. I figure out which is the back most corner of the data and work toward the front from there. The code would be quite concise if it wasn't for the need to draw the background grid lines (particularly ugly), and the sides (simple). The output looks good on devices that support fill. It looks weird on devices that don't but the old method did too. gb |