Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!mailrus!uflorida!stat!vsserv!loligo!pepke From: pepke@loligo (Eric Pepke) Newsgroups: comp.graphics Subject: Re: Z-Buffer Edge effects Message-ID: <147@vsserv.scri.fsu.edu> Date: 1 Sep 89 15:18:01 GMT References: <1972@diamond.warwick.ac.uk> Sender: news@vsserv.scri.fsu.edu Reply-To: pepke@loligo.UUCP (Eric Pepke) Organization: Supercomputer Computations Research Institute Lines: 36 In article <1972@diamond.warwick.ac.uk> arthur@flame.warwick.ac.uk (John Vaudin) writes: >If I render a cube from an isometric view then the edges of the >back faces are visible. This is because the Z value for the pixels in >the edge of the front face and the edge of the back face are equal so the >visibility of the edge pixels is determined by the order in which the >drawn. > >I do not understand how to get round this problem. If two pixels have >the same Z value what do you do ? How do real systems get round this ? I don't know about all real systems, but most of the ones I have seen get around it by not documenting the problem and letting you find out after you buy the machine. :-) For the particular problem that you describe, however, when the polygons share vertices, there is a relatively simple solution: don't draw the edges. Use the Macintosh model where lines around polygons are considered infinitely thin, and only render the pixels that are honest-to-Chthulu in the interior of the polygon. You can pretty easily whip together a Bresenham system that does this in integral screen coordinates and guarantees that adjacent polygons will never overlap or leave gaps. If you do this, the normal case of filled abutting polygons will work quite nicely. If the user really wants to mess up the system by having objects that are coincident in 3-space and of different colors, well, life's rough. Now, if you really want to have fun, precompute the Bresenham error terms based on subpixel values of the transformed coordinates. Eric Pepke INTERNET: pepke@gw.scri.fsu.edu Supercomputer Computations Research Institute MFENET: pepke@fsu Florida State University SPAN: scri::pepke Tallahassee, FL 32306-4052 BITNET: pepke@fsu Disclaimer: My employers seldom even LISTEN to my opinions. Meta-disclaimer: Any society that needs disclaimers has too many lawyers.