Wondering...
Feb. 26th, 2007 10:04 amSo, what would be the best way to write a DDA (Digital Differential Analyzer) for drawing lines on a Hex Grid? Note that I may want to play with various aspect ratios for the hexes, and/or allow a scene to be viewed from different angles (and not just from the obvious 6).
- Divide the circle into 6 hexants, and have a routine thats a standard DDA using the two of the six 'axis' directions that lie on either side of the line. This will generate hex coordinates, to later be converted to (x,y) when drawing on the hex grid.
- Do everything in (X,Y) coordinates, using a modified DDA that precomputes the differences due to the current orientation and aspect ratios.
- a DDA is not the right tool for this job.
no subject
Date: 2007-02-26 03:56 pm (UTC)But what is DDA? Just the old algorithm to draw lines on a plotter that will only move its pen in eight directions? Or four? Or, in this case, six?
no subject
Date: 2007-02-26 04:15 pm (UTC)One of these DDAs is the heart of any process today that draws lines on a screen, although its now often implemented in hardware.
no subject
Date: 2007-02-26 04:16 pm (UTC)no subject
Date: 2007-02-26 04:16 pm (UTC)no subject
Date: 2007-02-26 04:18 pm (UTC)no subject
Date: 2007-02-27 02:10 am (UTC)