home *** CD-ROM | disk | FTP | other *** search
- From: bayes@hplvec.LVLD.HP.COM (Scott Bayes)
- Date: Wed, 16 Dec 1992 22:21:10 GMT
- Subject: Re: 3D Graphics
- Message-ID: <830022@hplvec.LVLD.HP.COM>
- Organization: Hewlett-Packard Co., Loveland, CO
- Path: sparky!uunet!spool.mu.edu!sdd.hp.com!hpscit.sc.hp.com!hplextra!hpfcso!hplvec!bayes
- Newsgroups: comp.sys.mac.programmer
- References: <723298789.AA00239@insane.apana.org.au>
- Lines: 25
-
- > Your illustration makes it appear that _LineTo doesn't divide up the
- > remainder pixels properly; that is, if n pixels are left over after
- > drawing the "main" portion of the line, QD puts one on one end and n-1
- > on the other end. Most people would put n/2 on one end and (n+1)/2 on
- > the other (integer arithmetic, you see).
- >
- > This doesn't have much to do with Bresenham, does it? He just gives an
- > algorithm for drawing, and whether or not you divvy up the remainder
- > pixels properly is up to you, right?
- >
-
- You interpreted my drawing correctly, though I may not have drawn it
- exactly right. I think Jon Witte's (sorry for spelling, Jon; USASCII
- kbd) diagram is better.
-
- As someone noted, Bresenham sets the "error accumulator"--e in his
- algorithm--up initially so that the two end runs of the line differ in
- length by 0 or 1 pixels. Apple probably uses a very similar algorithm
- (integer DDA) but initializes the variables differently.
-
- I notice that in 7.1, the lines don't seem to hook any more. I don't
- have a convenient 6.x to try that. Was I hallucinating the hooks? Mass
- hallucination???
-
- ScottB
-