Re: [AD] Line clipping fix

[ Thread Index | Date Index | More Archives ]

On Tue, 2004-01-27 at 07:59, Eric Botcazou wrote:
> Thanks for your efforts.
> > I've also made a test program to show the problems
> > with 4.1.12.
> There is indeed a problem, that I totally overlooked when I accepted the 
> Cohen-Sutherland patch.  The results of the drawing operations must be 
> identical if you clip before or after drawing.
> > I dont know anything about gettign this code into
> > allegro.  I assume that someone can (test and) apply
> > this patch?
> I've been thinking about this problem for more than a week.  My viewpoint is 
> currently the following:
> - the original code (4.1.11) is correct, simple and slow,
> - the new code (4.1.12) is incorrect, simple and fast,
> - your code is correct, complicated and a bit faster than the original code.

I think, if Doug's code could be made as fast as 4.1.12 for unclipped
lines, it would be preferable. It would still be slower than 4.1.12 for
clipped lines, since it has to do the additional Bresenham clipping -
but that's what is necessary to make it correct. In all cases, it would
be faster than 4.1.11.

The only question is, how much more complicated does the code have to be
to additionally detect unclipped lines, and then use do_clip with
unclipped putpixel in that case (like 4.1.12) - which still has to draw
the exact same lines the clipped Bresenham version.

Elias Pschernig <elias@xxxxxxxxxx>

Mail converted by MHonArc 2.6.19+