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
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