3 ms·
What's wrong with drawing (possibly resulting in thicker line) pixels everywhere the mathematical line intersects the pixel?
by hoseja 4y ago
What's wrong with drawing (possibly resulting in thicker line) pixels everywhere the mathematical line intersects the pixel?
- Sharlin 4y agoPerformance. The point of line drawing algorithms like Bresenham is to not need to do anything like costly floating-point intersection tests for every pixel. Also aesthetics: a single-pixel width line with occasional doubled pixels just looks uglier than one without them. That said, the algorithm for finding every cell in a grid lattice that intersects a line is occasionally useful for purposes other than line drawing.
- deleted 4y ago[deleted]