Re: [AD] Re: Re: Line clipping bug found

[ Thread Index | Date Index | More lists.liballeg.org/allegro-developers Archives ]


On Thu, 2004-01-08 at 21:46, Elias Pschernig wrote:
> Yeah. As I said - ideally someone would add code to the clipping to also
> clip the Bresenham line drawer state. So we would always have fast and
> correct code :)
> 

I looked a bit at the Bresenham algorithm again - and it should be
doable - but not in combination with Cohen-Sutherland. Clipping could
only be done against the major Bresenham direction (therefore the loop
is only as long as the clipping rectangle) - but no unclipped putpixel
could be used, since the line can go out in the secondary direction. So,
there would be no more 1000000 loop for 'line(1000000...)' - but there
would be per-pixel-clipping and no more Cohen-Sutherland.

I'll try to do some timings..

-- 
Elias Pschernig <elias@xxxxxxxxxx>





Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/