|
|
On 20/08/2011 12:11 PM, Warp wrote:
> Orchid XP v8<voi### [at] devnull> wrote:
>> The assignment was basically to implement Bresenham's Algorithm,
>> optionally *with* antialiasing for extra marks.
>
> IIRC the algorithm in question can be used to roughly *approximate*
> antialiasing of the line, but it's not mathematically accurate.
>
> Drawing an accurate antialiased line (of certain width) is not a trivial
> problem. Basically for each pixel you need to calculate how much of it is
> covered by the line. Doing this accurately with integer math only can be
> complicated.
In the simple case of lines beginning and ending on pixel boundaries,
it's pretty easy. I'm not aware of any way in which Bresenham's
algorithm deviates from a perfect solution.
On the other hand, if you want lines that begin and end at fractional
coordinates, or have rounded ends or whatever, the problem becames far
more complicated.
--
http://blog.orphi.me.uk/
http://www.zazzle.com/MathematicalOrchid*
Post a reply to this message
|
|