Lava lamp is a good name as it is mesmerizing to watch. Great job!
I searched in vain for perlin noise implemented in ThinBasic. So decided to create something similar, based on random numbers, but easily controllable. I came up with the idea of a sparse array with some randoms numbers and a second detail array which interpolates over the random numbers using cosine interpretation to ensure smooth transitions. I had to precompile the cosine values and the hues to get some performance improvement. I did try and convert it to Oxygen but I couldn't work out how to pass two dimensional arrays. But the code runs reasonably "as is" on my 5 year old laptop.
I am using the basic smoothed set of random numbers to create the image. I then evolve the array by a set of small delta random numbers which shifts the values in a controlled way. I then take a small percentage of the base random numbers set and add them to the row above to create the "rising" effect. I am using random numbers, but you can put anything into the base array. If the regular coordinates is a concern, you can still use this approach and then apply a transformation to get the final shape you desire. e.g. rectangular to polar coordinates.
And yes I know it does not look like a lava lamp but I didn't think of a better description right now.
Lava Lamp.jpg
and the code is here:
LavaLamp.tbasic
Lava lamp is a good name as it is mesmerizing to watch. Great job!
Great! Its wonderful.
Yes, really great.
Thanks for sharing it
Still trying to understand how it works but .... This is my lack of knowledge on the specific matter
www.thinbasic.com | www.thinbasic.com/community/ | help.thinbasic.com
Windows 10 Pro for Workstations 64bit - 32 GB - Intel(R) Xeon(R) W-10855M CPU @ 2.80GHz - NVIDIA Quadro RTX 3000
Bookmarks