## Is bresenhams line algo the ONLY algo?

### Is bresenhams line algo the ONLY algo?

Quote:> hi everyone,

> I'm looking for speed and well, I'm left wondering if there is a way of
> drawing a line (I'm interested mainly in it's ability to scan down the
side
> of a polygon) that doesnt involve bresenhams? are there any other? perhaps
> higher performace algorithms

> thanks, just a short one :P keep your brains ticking over

Actually, yes.

Even though the theoretical textbooks always use Bresenham's, everybody else
uses other algorythims.

Best bet, for the most part, is to reduce the angled line to a series of
horizontal or vertical lines and then process those.  Then you get a
relitively simple loop.

I'm handwaving a lot here..

But if you are doing appreciable calculations at each pixel -- more than
just drawing -- it's probably better to just use Bresenham's.

### Is bresenhams line algo the ONLY algo?

hi everyone,

I'm looking for speed and well, I'm left wondering if there is a way of
drawing a line (I'm interested mainly in it's ability to scan down the side
of a polygon) that doesnt involve bresenhams? are there any other? perhaps
higher performace algorithms

thanks, just a short one :P keep your brains ticking over

kosh

### Is bresenhams line algo the ONLY algo?

> I'm looking for speed and well, I'm left wondering if there is a way of
> drawing a line (I'm interested mainly in it's ability to scan down the side
> of a polygon) that doesnt involve bresenhams? are there any other? perhaps
> higher performace algorithms

In general, scan-converting a polygon is not the best place to use
Bresenham's.  If you're trying to just rasterize a line, then
Bresenham's is a good.  Wu also originally had a modification of
Bresenham's where he doubled all the parameters and used it to test for
the next two pixels at every loop (what would the pattern of the next
two be)
The main thing is that Bresenham's has a fair number of idle loops.
The thing is that when you actually fill the polygons, there are going
to be pixels on the edges that you will anyway overwrite if the line is
complete.  A simple divide and run through all the y positions to find
x-positions is usually enough.  With Bresenham's, since you're concerned
with edges, you're going to keep looping and not write a value until a
change in the dependent axis occurs.

- Parashar K.

### Is bresenhams line algo the ONLY algo?

Check out the latest issue of IEEE Computer Graphics and Applications
(Nov/Dec 2000),
ther you can find a tutorial on the subject:

"Why step when you can run?" by Peter Stephenson and Bruce Litow

### Is bresenhams line algo the ONLY algo?

> an ancient book called "The Sinclair ZX81 Pocket
> Book" :-D and I am using it all the time.

> As far as I can tell, it looks very efficient, and I think it is
> *not* Bresenham.

I have met Bresenham and I can certainly say that your
algorithm is not him.

Quote:> However, I do not think that it is *more* efficient
> than Bresenham.

Agreed.  Bresenham is one of the most efficient people
I have ever met.

By the way, if you look closely at the code, you will see
the characteristic decision variables that show up in
Bresenham's line drawing algorithm.  Certainly the code
is at most a minor variation on what you might see in
the text books or elsewhere.

--
Dave Eberly

http://www.magic-software.com

### Is bresenhams line algo the ONLY algo?

I use bresenham to edgescan my polygons (flatshaded) and for 2 D lines it is
quite a bit faster (because of the lack of doubles and casts).

But trying to do bresenham for gouraud shaded, perspective correct, texture
mapped polygons was hell, very long code and it was slower than just
interpolating. Is there a fast way to do say 5 or 6 dimensional bresenham
that is faster than interpolation??

### Is bresenhams line algo the ONLY algo?

Quote:> I use bresenham to edgescan my polygons (flatshaded) and for 2 D lines it
is
> quite a bit faster (because of the lack of doubles and casts).

> But trying to do bresenham for gouraud shaded, perspective correct,
texture
> mapped polygons was hell, very long code and it was slower than just
> interpolating. Is there a fast way to do say 5 or 6 dimensional bresenham
> that is faster than interpolation??

in my opinion: no :)

Hi All,

Could anyone tell me if its possible to calculate how many pixels will be
drawn using Bresenhams circle algorithm, specifically when this algo is
used to draw circular arcs ?, this is for a stepping motor project and not
graphics, but the raster device model remains the same.

Thanks......
Ken.