(08-31-2024, 08:10 AM)Thanks Bplus, I was wondering why it wasn't being used. I still have the original one, I'll try to use that, or Dav's. bplus Wrote: Thats really slow and doesn't work for transparent colors
Code: (Select All)Screen _NewImage(800, 600, 32)
diameter = 200
Circle (400, 300), diameter, _RGB32(0, 255, 0)
Locate 1, 1: Input "Press Enter To Fill Circle", a$
For sz = .1 To diameter Step .1
Circle (400, 300), sz, _RGB32(255, 0, 0, 10)
Next sz
This old way is slow and leaves border and does not work with transparent borders
Code: (Select All)Screen _NewImage(800, 600, 32)
diameter = 200
Circle (400, 300), diameter, _RGB32(0, 255, 0)
Locate 1, 1: Input "Press Enter To Fill Circle", a$
Paint (400, 300), _RGB32(0, 0, 255, 40), _RGB32(0, 255, 0)
|
Another small filled circe sub (not as fast as fcirc)
|
|
08-31-2024, 04:36 PM
(08-31-2024, 03:00 AM)bplus Wrote: here's where it gets "fun" So I ran Mark's code on my Merlin 1200 and got the opposite results... As far as While/Wend goes, absolutely nothing against it or any other iteration loops in our tool box. I was pointing out some subtle differences between entry and exit types, While/Wend vs Do While/Loop, and postulating that there may be a speed difference. Fun thread... Pete
Shoot first and shoot people who ask questions, later.
Looks like FC_Dav* came in first, like my first screen shot test of Samuels' code after modifying the order of the tests.
FC_Dav* came in 2nd in my 2nd screen shot. * FC_Dav is Samuels name system, I prefer FC3. What is opposite? You are opposite Samuel's screen shots because you used my code and ran Gold first in the sequence and for some reason that is the unlucky position. Put any of them in first run position and they will likely do the worse. Don't ask me why the first run is so handicapped but I find it over and over! These subs are so close that anything in background like browser or running IDE in background or move your mouse or fart and the results will be different. I think any of these versions including the Square Filled Circle fill are fast enough to serve the circle fill function, so at this point I'd say it's a matter of which appeals to you. The Gold Standard and the Square filled are definitely the most insteresting and vince version is not far from the Gold Standard, so ??? If I want to save on LOC I will go with FC3.
724 855 599 923 575 468 400 206 147 564 878 823 652 556 bxor cross forever
08-31-2024, 09:01 PM
I like FC3 modified this way...
Code: (Select All)
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.
(08-31-2024, 09:01 PM)Pete Wrote: I like FC3 modified this way... 2 problems with your code: 1) overlapping lines, 3 are drawn actually, at the equator y = 0 2) you exit before y gets drawn with 2 lines at the r value All is fixed by this! Code: (Select All) Screen _NewImage(800, 600, 32)
724 855 599 923 575 468 400 206 147 564 878 823 652 556 bxor cross forever
08-31-2024, 11:35 PM
That works, + 1.
Pete
Shoot first and shoot people who ask questions, later.
Thanks!
Preparing FC3 for my toolbox I ran into a little snag, when r = 0 the SQR bombs so we have to exit if r < 1. If r < 1 Then Exit Sub or Pset(cx, cy), clr~& and then exit sub Here is a little demo of FC3 working off Old Moses demo of square filled circle fills: Code: (Select All) _Title "FC3 best version yet" ' b+ 2024-08-31
724 855 599 923 575 468 400 206 147 564 878 823 652 556 bxor cross forever
09-01-2024, 12:17 AM
That looks pretty solid, bplus. I don't think it can be further optimized. The DIM line added for option explicit doesn't seem to slow it down at all for me here.
- Dav
Yes and I don't expect the Loop Until to change anything with speeds either.
I like how allot of people have a little piece of this small routine ![]() Still need to run speed tests with this version. I'll let you all know if something unexpected comes up.
724 855 599 923 575 468 400 206 147 564 878 823 652 556 bxor cross forever
09-01-2024, 02:23 AM
Ok. So, I did some research and figured out that the FC_Gold (a.k.a. FC0) performs well because it avoids the branching (ELSE part) inside the main loop. I made some modifications to optimize it even further. It avoids some unnecessary things keeping in mind not to overdraw pixels and hence not screwing up alpha blending.
Code: (Select All)
|
|
« Next Oldest | Next Newest »
|
| Possibly Related Threads… | |||||
| Thread | Author | Replies | Views | Last Post | |
| A Small Game Tutorial (from 2014) | SMcNeill | 2 | 970 |
11-13-2023, 09:11 PM Last Post: Kernelpanic |
|
| Small exploding image and fade-out effect | Dav | 18 | 3,526 |
09-08-2023, 11:16 PM Last Post: dbox |
|
| Space Orbs. Small screen saver. | Dav | 16 | 3,133 |
08-27-2023, 07:52 PM Last Post: grymmjack |
|
| Ball Sub - draws several kind of filled, textured balls (circles) | Dav | 15 | 3,481 |
08-23-2023, 09:31 PM Last Post: Dav |
|
| Improved my small Gradient Ball drawing SUB | Dav | 22 | 5,298 |
07-13-2023, 05:23 PM Last Post: Dav |
|
Users browsing this thread: 1 Guest(s)



