[A89] Re: filling ellipses


[Prev][Next][Index][Thread]

[A89] Re: filling ellipses




At 04:07 2001-07-09, you wrote:
>You could change the bresenham ellipse, just sligthlty, to only draw the
>lines when it changes in y. (if you use horizontal lines)
>then it would work with xor, since it would never overlap. not very
>advanced to modify it too (if only one would find a working bastard,
>couldn't find where this was wrong, and I'm leaving home now for two weeks)
>have to move the draws, to draw in the if-statements right before where y
>and x or only y, changes.  and no draw when only x changes.
>and much much faster and much much much much more memory efficiant, then
>your double buffer sollution.
>
>///Olle

a note: you need a special case for the middle line also. A test to see if 
y = 0, only draw one of the lines, should do it... (if y = 0, both lines in 
the drawing would be at the same place)

This all is btw a good idea even with not using xor for a filled ellipse.
you should never write the same pixel twice, if not extremly difficult not to.
Drawing twice is a waste of time.

and about the double buffer...  copying big blocks of memory is never fast.
you should at least modify it to only copy the parts you actually draw on, 
and not the whole double buffer every time.
consider for example a 10x10 ellipse in one corner. quite silly to then 
copy 3000 bytes when only 20 of them makes any difference.

memory access is slow and should be kept at a minimum.
this is just as true as keeping divs and muls low.

///Olle




References: