Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Another small filled circe sub (not as fast as fcirc)
#94
I suspect I know what this is doing:
Code: (Select All)
e = e + 2 * y0
else
e = e - 2 * x0

Can you put it into words so maybe I can confirm my suspicions.

BTW what we are calling Steve's is a version of Bresenham
from StackOverFlow
void circle(Point p, int r) {
int x = 0;
int y = r;
int f = 1-r;

// plot vert/horiz points indepedently

while (x<y) {
x++;

if (f<0) {
f += 2*x+1;
} else {
y--;
f += 2*(x-y+1);
}

glRecti(p.x+x, p.y+y, p.x+x+1, p.y+y+1);
// plot other points using 8 way symmetry

// attempt to fill the circle - didn't go well
plotLine(Point(p.x, p.y+x), Point(p.x+x, p.y+x));

}
}


Update: that code is wrong! "didn't go well" indeed! Smile

which looks more like vince version!

No creators here just copiers LOL we stand on shoulders of other great copiers.
BTW I was just watching argument of Creationist against evolution because I got into discussion about man not evolving from ape but BOTH evolving from a common ancestor species down the tree of Life.
b = b + ...
Reply


Messages In This Thread
RE: Another small filled circe sub (not as fast as fcirc) - by bplus - 09-03-2024, 04:15 PM



Users browsing this thread: 4 Guest(s)