Path: utzoo!utgpu!jarvis.csri.toronto.edu!cs.utexas.edu!mailrus!cornell!klassen From: klassen@gvax.cs.cornell.edu (R. Victor Klassen) Newsgroups: comp.graphics Subject: Re: How does pr_vector() work ? Message-ID: <38280@cornell.UUCP> Date: 7 Mar 90 15:34:48 GMT References: <1990Feb25.222157.26389@allgfx.agi.oz> Sender: nobody@cornell.UUCP Reply-To: klassen@gvax.cs.cornell.edu (R. Victor Klassen) Organization: Cornell Univ. CS Dept, Ithaca NY Lines: 32 In article <1990Feb25.222157.26389@allgfx.agi.oz> shn@allgfx.agi.oz (Si-Hanh NGUYEN) writes: > >Does anybody know the detailed algorithm used in pr_vector() of Sun Pixrect ? >The manual says that "pr_vector draws balanced vectors. (The technique used >is to balance the Breshenham error term)". > There are two papers of which I am aware which address what I beleive to be the balancing to which the Sun manual refers. %A J. Boothroyd %A P.A. Hamilton %T Exactly reversible plotter paths %J Australian Computer Journal %V 2 %N 1 %P 20-21 %D 1970 %K reversible incremental interpolation %A D.E. Field %T Incremental linear interpolation %J ACM Transactions on Graphics %V 4 %N 1 %P 1-11 %D January 1985 %K DDA Bresenham scan conversion The issue is one of rounding down or toward zero. I don't have anything more at my fingertips, but I think you want to round down when you do the division in the initialization, which isn't what most processors do if you're in the wrong octant.