-=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- (c) WidthPadding Industries 1987 0|608|0 -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=-
SoCoder -> Snippet Home -> Graphical Effects


 
Andy_A
Created : 24 January 2011
Edited : 24 January 2011
Language : Blitz

Bresenham like Circle and Ellipse functions

Both of these functions are faster than 'Oval'

I stumbled upon these algos on the internet and have made them into functions that will display filled and unfilled circles/ellipses - just like the Blitz "Oval()" function.
However, scan line filled ovals are about 10x slower than Blitz's

If you have lots of circles or ovals to plot, these functions will allow you to have 5 to 10 times as many ovals as Blitz 'Oval()'. It appears that the slower your machine the faster these functions will perform compared to 'Oval()'.

In timing these compared to the intrinsic Blitz 'Oval()', I noticed that Blitz filled ovals are much faster that an unfilled oval.



P.S.
Maybe someone could code these in Cobra to see how they stack up to Graham's intrinsics.


Circle:



Ellipse:

 

Comments


Wednesday, 26 January 2011, 04:42
Jayenkai
Can't argue there! Them's some nice circles!!
Wednesday, 26 January 2011, 12:53
Andy_A
I'm blushing... No one ever commented on my circles!