Jump to content

Talk:Digital differential analyzer (graphics algorithm)

Page contents not supported in other languages.
From Wikipedia, the free encyclopedia
This is an old revision of this page, as edited by SineBot (talk | contribs) at 07:38, 6 September 2008 (Signing comment by 85.19.218.76 - ""). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.

Cleanup performed

Removed the cleanup tag because the article is IMO a lot clearer and of higher quality since August 2007 when the article was tagged. I also removed the context tag for the same reason. 82.181.93.246 (talk) 19:44, 12 January 2008 (UTC)[reply]

update

I added a reference, simplified the floating-point code sample and added codelets for multi-component interpolation and integer operation. Please review and check for bugs & errors... -- 89.247.29.115 (talk) 09:08, 8 July 2008 (UTC)[reply]


Er... I think the fixed point dda must be wrong. there should be no reason for the "overflow check".

here is my version (quick and dirty. draws in 45 deg. only, with dx > dy, all vars positive ints)

   // F is num of bits in fraction
   
   draw (x1, y1, x2, y2)
       dx = x2 - x1
       dy = y2 - y1
       x = x1
       y = y1 << F
       m = (dy << F) / dx // this integer division can also be looked up in a table
   
       while x < x2
           plot x, y >> F
           x += 1
           y += m
       

Hard to beat two adds and a shift, or what? /Nurse Dragonbreath —Preceding unsigned comment added by 85.19.218.76 (talk) 07:37, 6 September 2008 (UTC)[reply]