home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #30 / NN_1992_30.iso / spool / comp / sys / mac / programm / 20016 < prev    next >
Encoding:
Internet Message Format  |  1992-12-20  |  1.5 KB

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