Sunday, April 3, 2011

Project : Chibi Wars Game Engine pt.2 of ??? (midpoint algorithm)

So I found this awesome algorithm which already exists called "midpoint algorithm". I tried to understand it before using it in my program. Understanding failed, but as a true NYP student, I managed to use the algorithm without understanding it!

So here're the results

0 Pixel radius circle
1 Pixel


2 Pixel

3 Pixel

4 Pixel

5 Pixel























The more observant may have noticed one thing:


Re-using the formula with a while loop,
decreasing the radius by 1 each time
That's right, there are some pixels that are left alone, the poor things ;_;. The way I see it, there are 2 solutions. One, to change the formula somehow such that these pixels are not left out in their respective circles, or two, to ignore the pixels being left out and to write an easier algorithm that works with this to fill in the circles. I'm more inclined towards the former, but I may not have the brain capacity.

No comments:

Post a Comment