11-08-2025, 07:52 PM
Oooh, I'd been thinking about rotation, but you've achieved it!
Will give this a try when I get back to the computer.
Thanks!
Will give this a try when I get back to the computer.
Thanks!
|
trouble filling in a closed vector shape
|
|
11-08-2025, 07:52 PM
Oooh, I'd been thinking about rotation, but you've achieved it!
Will give this a try when I get back to the computer. Thanks!
11-09-2025, 04:53 PM
@bplus
Thanks bplus. I'm glad my idea inspired you. Have you tried adding transparency to the plasma color calculation? Maybe that would improve the effect. Also - is it intentional that all three channels of the plasma color are calculated the same? Wouldn't it be better if each color had a slightly different SIN factor, so its value would fall and rise differently?
11-09-2025, 05:33 PM
(11-09-2025, 04:53 PM)Petr Wrote: @bplus In ResetPlasma you will see a separate randomly selected value for each primary hue: Red = PR, Green = PG and Blue = PB, they are Dim Shared variables. Code: (Select All) Sub resetPlasma ()That creates a unique color pallet. CN allows the pattern to be sequenced so that it repeats cyclically after so many calls depending on the unique pR, pG, pB set. Code: (Select All) Function Plasma~& ()The Plasma calc looks the same with the 127 + 127 * Sin (... but that just allows full expression of the range between 0 and 255 for each hue depending on the expression inside of the Sin() calc. You could alter and deaden the drama by changing the 127's but for most general purposes the full range is nice effect. Transparencies might be interesting in coloring where overlap becomes interesting. I will look for an opportunity to test that, thanks!
724 855 599 923 575 468 400 206 147 564 878 823 652 556 bxor cross forever
11-09-2025, 05:39 PM
Some cool ideas guys - unfortunately this is a busy weekend so my computer time is limited, but I look forward to playing with your code when I can!
11-10-2025, 06:01 PM
(11-08-2025, 07:44 PM)bplus Wrote: A little mod of numbers:Okay @bplus, I was playing with your code, and saw some strange behavior. Download the attached files and give them a run. 2 questions: Q1: For FreeImage, I use a simple routine that checks to make sure the image is initialized before it does _FreeImage, so it doesn't blow up: Code: (Select All) Sub FreeImage (ThisImage&)I reverted back to the regular _FreeImage and did a check of the image handle value, and it doesn't change before or after the _FreeImage. Shouldn't the value of the image handle go to 0 after it is freed? Q2: I don't know why, but for some reason in my version, the colors are these subdued pastels, and not the vibrant colors you had. What happened? Anyway, I like your proggie, I'm just a little baffled by these 2 things...
11-10-2025, 06:43 PM
Wait you rewrite my code into your sub and want me to debug it for you?
off the top of my scan of what you have... Quote: ' ***************************************************************************** Why are you freeing both images? I saved the original to recall over and over and swapped colors with the original Black color that the .png used for the image we want to duplicate in different colors. Just free the changed color image and save original to reswap colors. so thats maybe where the on error is coming from. dang why cant you put everything in a single zip for easy download and extract, instead of making me work to download the png then download your code and then connect the 2 in a folder. I did that for you please return the favor specially if you want me to debug your mistakes. Sorry feel'n lazy today. I say study my code that works more carefully. If btest = _True where did you define _True? no where that I can see so it = 0 which is false.
724 855 599 923 575 468 400 206 147 564 878 823 652 556 bxor cross forever
(11-08-2025, 07:30 PM)bplus Wrote: @Petr you inspired me!I have another question BPlus. My prog (see attached) uses Sub RotoLine (which uses Sub RotoZoom23d , or now Sub RotoZoom23d3 which I based on the updated RotoZoom in your vh logo program). Anyway, either way, I'm wondering how we might modify RotoLine and/or RotoZoom to get the stripes to extend all the way off the screen, so you don't see those corners at the end? I have tried messing with the variables but haven't found anything that worked. ![]() Any help or guidance much appreciated! (11-10-2025, 06:43 PM)bplus Wrote: Wait you rewrite my code into your sub and want me to debug it for you? Didn't really rewrite it, just renamed vars and minor tweaks to match my program. (11-10-2025, 06:43 PM)bplus Wrote:Quote: ' *****************************************************************************Why are you freeing both images? At the end, don't we want to free up our objects, images, etc.? That's just standard housekeeping, right?? Per the wiki: Quote: Which is why I do If t& < -1 Or t& > 0 Then _FreeImage t& However, reading the wiki, they also say this:
so that explains why the value didn't change to 0 after doing a _FreeImage. So my code If t& < -1 Or t& > 0 Then _FreeImage t& doesn't really guarantee that the image handle is valid or hasn't already been freed. So that answers my question (why was it blowing up?) and leads to a followup question: is there any graceful way to check first if an image handle is valid or has already been freed before calling _FreeImage? I'm not expecting you to answer it, just telling you where I'm at. (11-10-2025, 06:43 PM)bplus Wrote: I saved the original to recall over and over and swapped colors with the original Black color that the .png used for the image we want to duplicate in different colors. Just free the changed color image and save original to reswap colors. Yes but none of your logic changed, I was just not sure why my FreeImage wasn't working. I thought that maybe the swap color routine (which uses mem) did something funny with the image handle that I don't understand. But reading the wiki more carefully, I see why it failed. (11-10-2025, 06:43 PM)bplus Wrote: dang why cant you put everything in a single zip for easy download and extract Wow, I really annoyed you today... Sorry! My question was specifically, why is the FreeImage blowing up. Your code still worked otherwise (apart from the colors now looking kinda pastel). I wasn't asking you to debug a non-working program, just wondering what is up with the FreeImage. (11-10-2025, 06:43 PM)bplus Wrote: If btest = _True where did you define _True? You know _TRUE and _FALSE are now native to QB64PE now, right? No need to define them anymore.
Quote:You know _TRUE and _FALSE are now native to QB64PE now, right? No need to define them anymore. No in one ear out the other eye I haven't updated since 4.0 , so now tell me _True is -1 in 4.0 LOLoops sorry.
724 855 599 923 575 468 400 206 147 564 878 823 652 556 bxor cross forever
11-10-2025, 09:18 PM
Quote:My question was specifically, why is the FreeImage blowing up. Are you saying freeimage is blowing up from my code? I ran it for some time, no sign of leaks??? Quote:bplus Wrote: Wrote:Quote: Wrote: ' *****************************************************************************Why are you freeing both images? Yeah I realised this later.
724 855 599 923 575 468 400 206 147 564 878 823 652 556 bxor cross forever
|
|
« Next Oldest | Next Newest »
|
| Possibly Related Threads… | |||||
| Thread | Author | Replies | Views | Last Post | |
| simple 3d starfield & wireframe or vector graphics revisited | madscijr | 5 | 263 |
01-31-2026, 09:41 PM Last Post: Pete |
|
| trouble building ansiprint by a740g | hsiangch_ong | 2 | 578 |
01-09-2025, 12:57 AM Last Post: hsiangch_ong |
|
| Having trouble Windows command line SORT via SHELL | GTC | 19 | 4,367 |
08-26-2023, 04:19 AM Last Post: GTC |
|
| How do I paint a shape? | PhilOfPerth | 21 | 3,921 |
06-28-2023, 10:09 PM Last Post: TempodiBasic |
|
|
|
Ellipse trouble | james2464 | 14 | 2,998 |
08-25-2022, 10:52 PM Last Post: james2464 |