Saturday, December 02, 2006

bezier progress

Xach's comment referring me to a paper at the Anti-Grain Geometry site on estimating bezier curves using line segments was spot on. I had to replace the AA line-drawing algorithm to use fractional pixel locations. As you can see from the above, the line segments do a pretty good approximation. There are still some issues with how the individual line-segments meet up that can be seen in the image. I think this is because when two lines meet at a pixel location, the last line to be drawn overwrites the pixel color instead of adding its contribution. This code will also give me an excuse to finally dig into CL optimizations like type declarations and inlining. From some debugging output, I know that some of the code is actually using rationals. I'm almost sure that can't be good for speed



Post a Comment

<< Home