3 ms·
In the first case, then yes, you are taking care to avoid one of the problems a naive approach has. In the second case, you'll end up with blobby lines. For a
by tasty_freeze 9y ago
In the first case, then yes, you are taking care to avoid one of the problems a naive approach has.
In the second case, you'll end up with blobby lines. For an x-major line, the standard algorithm would plot one pixel for every unit in X. With your approach, some x's would get one pixels, and some would get two (at adjacent y's on either side of the ideal y)
- vanderZwan 9y agoAh true, you need some form of anti-aliasing for that, which would basically end up at something like Xiaolin Wu's algorithm. https://en.wikipedia.org/wiki/Xiaolin_Wu%27s_line_algorithm https://en.wikipedia.org/wiki/Xiaolin_Wu%27s_line_algorithm