Re: Drawing floating-point lines with Bresenham
- From: Thomas Kindler <thomas.kindler@xxxxxx>
- Date: Wed, 16 Jul 2008 23:44:40 +0200
Kaba wrote:
Thomas Kindler wrote:Hi!
I've written a graphics library that supports fast Bresenham line drawing. I can give an integer starting point, integer number of pixels, error increments for minor/major steps, and an initial error value for the first pixel to draw.
Now I would like to draw lines with floating-point endpoints.
Does anyone know how to initialize the error terms to correctly draw lines with non-integer endpoints?!
I don't. However, you could go up to the roots:
"Algorithm for computer control of a digital plotter"
by J.E.Bresenham
That's the paper introducing Bresenham's line algorithm. Google finds it. Maybe you can derive the initial error term based on the paper.
Cool! And I could even download it for free.
That's the problem with basic stuff like this. Everyone knows some version of the algorithm, the basic idea is thaught everywere, but no one can point to a good (and fully correct) implementation.
The sad thing is that all the original papers are available online, but all of them require me to be a member of the ACM or IEEE :-/
Getting the Cohen-Sutherland clipping to work while preserving the slope of the original line was an adventure in it's own right.. I didn't find a single lecture that explains the error-term update, because it always seems to be "out of scope" for a graphics course. (I finally found a good explanation in the x.org library code).
--
"Zuse, Zuse" sprach die Tante, als das Rechenzimmer brannte
www.microsoft-hellhounds.de, www.bredobrothers.de
.
- Follow-Ups:
- References:
- Drawing floating-point lines with Bresenham
- From: Thomas Kindler
- Re: Drawing floating-point lines with Bresenham
- From: Kaba
- Drawing floating-point lines with Bresenham
- Prev by Date: Re: B-splines and coordinates?
- Next by Date: Re: Drawing floating-point lines with Bresenham
- Previous by thread: Re: Drawing floating-point lines with Bresenham
- Next by thread: Re: Drawing floating-point lines with Bresenham
- Index(es):
Relevant Pages
|
Loading