Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Another small filled circe sub (not as fast as fcirc)
#74
I like FC3 modified this way...

Code: (Select All)
Sub fc3 (cx, cy, r, clr~&)
    Line (cx - r, cy)-(cx + r, cy), clr~&, BF
    r2 = r * r
    Do
        x = Sqr(r2 - y * y)
        Line (cx - x, cy + y)-(cx + x, cy + y), clr~&, BF
        Line (cx - x, cy - y)-(cx + x, cy - y), clr~&, BF
        y = y + 1
    Loop Until y = r
End Sub

I favor the SQR() method as it was what I ran with in the flat ellipse project. I did have to use _INTEGER64 for the non-x and non-y variables to get uniform results with various ellipse sizes. I don't know if a circle fill would have similar/same size issues. I also recall something a bit off with QB64 SQR() while doing string math, where complex calculations differed a bit from online calculator sources. I'm not quite sure where that info was documented. The flat ellipse stuff in in the thread: https://qb64forum.alephc.xyz/index.php?topic=1044.0

BTW - I've speed tested my modification. It won twice and lost once. There is no definitive way of knowing, so I'm going with what I consider the best looping process, unless otherwise proven definitively incorrect. I can picture Steve wringing his
hands as I speak!

Pete
Shoot first and shoot people who ask questions, later.
Reply


Messages In This Thread
RE: Another small filled circe sub (not as fast as fcirc) - by Pete - 08-31-2024, 09:01 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  A Small Game Tutorial (from 2014) SMcNeill 2 981 11-13-2023, 09:11 PM
Last Post: Kernelpanic
  Small exploding image and fade-out effect Dav 18 3,548 09-08-2023, 11:16 PM
Last Post: dbox
  Space Orbs. Small screen saver. Dav 16 3,173 08-27-2023, 07:52 PM
Last Post: grymmjack
  Ball Sub - draws several kind of filled, textured balls (circles) Dav 15 3,508 08-23-2023, 09:31 PM
Last Post: Dav
  Improved my small Gradient Ball drawing SUB Dav 22 5,348 07-13-2023, 05:23 PM
Last Post: Dav

Forum Jump:


Users browsing this thread: 1 Guest(s)