Click to See Complete Forum and Search --> : Need help modifing the Bresenham ellipse algorithm to draw varying line weights.


Mark_S
March 1st, 2005, 09:45 PM
I am writing some utilities for a Macintosh based sprite engine, SpriteWorld.

The engine supports tile based levels and the utilities draw geometric objects (rectangles, round rectangles, ellipses, lines, Bezier curves, etc.) using tiles instead of pixels.

I need the ellipse code to draw ellipses with varying line weights, but I have been unsucessfull in finding any resources on the internet. The only thing I can come up with is to draw a rectangle (pen width x pen height) for every pixel, but that produces very poor results.

I've included the source code that I'm using. It's a standard Bresenham algorithm, but modified to draw ellipses enclosed in a rectangle, rather than the standard center point - radius method.

The included source has quite a bit of SpriteWorld functions, but the code should be pretty self explanatory. I can explain the various functions if needed.

I am really at a loss. Any help will be appreciated.

Thanks,
Mark Speir

Elementer
March 2nd, 2005, 07:50 AM
http://www.robots.ox.ac.uk/~awf/graphics/bres-ellipse.html

http://www.cs.swarthmore.edu/~ngueret1/graphics/e26lab2/

http://homepage.smc.edu/kennedy_john/BELIPSE.PDF

http://www.vyomworld.com/source/show.asp?ScriptID=112

http://elm.fig.haverford.edu/~andrew/graphics/lab2/

Regards :)

Mark_S
March 2nd, 2005, 02:09 PM
Thank you, however, I am already able to draw one pixel wide (or in my case, one tile wide) ellipses. I need to be able to modify the code I have and posted here to draw ellipses pen width wide x pen height tall.

That is the code I am having trouble finding.