OMG I’ve always wanted one too! Built one from a kit from laser cut pieces. Fun project, but it sounds low quality. (Which it would as the kit cost less than 50 USD). So now I still want one.
I used to have a terrible soda habit - over 2 liters a day…until the kidney stones started. I always said I didn’t like water because it lacked flavor, but I also pretty strongly dislike those flavored water additives. So whenever water wasn’t enough and I craved more flavor I’d eat a couple pickled pepperoncinis and drink a glass of water. The peppers have barely any heat to them, but a lot of flavor. After about a month of that I just craved water and no longer missed the soda. I still love pepperoncinis, but no longer need their help.
Did the coding and execution last night and left optipng to convert the ppms to optimized pngs over night, but assembled the animated png for a new bit of programmatic art earlier today. Not sure what caused it, but all of the ppms triggered optipng’s error detection and I had to pass the --fix flag for the conversion to go through…
Anyways, the intention was to loop x, y, and z through the range -512 to 512 and set the pixel at position )x,y) of the zth frame by taking it’s radius from the origin, and if the radius is less than 256, setting red and blue to the raidus and if the raius is between 256 and 510, setting red and blue to 255 and green to the radius minus 255, and if the radius is greater than 510, just painting the pixel black. If things went as planned, I’m pretty sure the result should be an image that starts solid black before a white circle forms at the origin and grows, the center gaining a magenta tint as it grows increasing in saturation and then eventually fading to black as the circle nearly touches the edges before shrinking once more, though like with all my programmatic art, I have no clue how the end result compares with what I imagined.
Anyways, I uploaded the animated png to my website:
Also, I really need a better way to generate image files than writing ascii-based ppm. In this specific case, the ppms where over 8GB before the conversion to png compressed them down to 42MB.
Very fun!
This all worked as planned, but it looks like the circle was stretched along the x axis, and rotated maybe 30 degrees. It wraps off the left edge, and continues from the right edge, like it was vertically cut in half, and each half was placed on opposite sides.
However, with this shape, the size and colors change exactly as you described!
It’s pretty fascinating! Given your intent, I’m very curious to know how the function created this shape!
Wait, these exist??? Awesome!!
EDIT: Actually, after examining this further and shaking past some sleepiness, I just realized that the stretched circle seems to be rotated 45 degrees. The image is square and there’s a clear tangent connecting the lower left and upper right corner, so that means it’s 45 degrees!
EDIT 2: Nope! I was correct both times! I actually measured it! The tangent between each half-ellipse is 45 degrees, but each half-ellipse is rotated exactly 30 degrees! I have no idea how this works, but the geometry is very interesting!
EDIT 3: Okay, so more text description, because I might not be explaining this well! Each half-ellipse has the y coordinate placed halfway up the image, while one x coordinate places it on the left edge, and the other places it on the right edge. At full extension, these two halves are maybe one pixel away from touching. The ellipse on the left rises over the ellipse on the right, so their slopes seem to be positive. At full extension, they also each take up approximately two thirds of the image’s width. The ellipse on the right takes up the right two-thirds and bottom two-thirds of the image, while the ellipse on the left takes up the left two-thirds and upper two-thirds of the image.
This is one of those things where I would reconstruct the outlines with clay or sticky-tack in a square frame to present it in tactile form so it would be clearer, but hopefully I didn’t write this in a confusing way.
It’s quarter to 4 in the morning and I’m only posting because I decided to check for replies before going to bed, but I just did a skim of the code for logic errors and found that for the x layer of the triple four loop in my c++ I have x <+ 512 for the end condition instead of x <= 512… and I have no clue what <+ does and didn’t know it was a valid symbol in C++. Still, even without not being sure I’m understanding your descriptions well, it sounds like this typo had a rather interesting effect. Might also explain why optipng reported fixable errors with all of the .ppms my code generated.
But figuring this out will have to wait until after I’ve gotten some sleep.
And yeah, animated PNGs are a thing, and have been for over 20 years, but I get the impression the apng extension to png isn’t well known to the lay person and that most people conflate apng with gif despite apng supporting 24-bit RGB and 8-bit alpha while GIF is limited to a palette of 256 colors and a single bit of transparency. Unfortunately, .ppm, while having a ASCII format that’s easy to write and the ability to have up to 16 bits per color channel(ppm actually allows to specify an arbitrary number of intensity levels, up to 65536, though I stick to the standard 256 levels for the most part), has no support for alpha at all, so I haven’t been able to play around with images that aren’t fully opaque and I can only do animations through generating several stills and then combining them into an animation after converting to png.
It’s now 4:27 and I’m off to bed. Good night.
Okay, couldn’t find <+ in any references on C++ operators online, so I pulled up my most generic template of a new C++ source file and wrote a simple for loop that just prints the value of x with each iteration.Using x <+ 20 in the test, the output counted up to 19 before stopping, so apparently its parsing as less than to the compiler. If so, that would mean my code is producing 1024 pixels per line for what is supposed to be a 1025 pixel wide image, and the ascii version of ppm just lists pixels in order as whitespace delimited RGB triplets with no internal structure. It’s like wrapping a monospace text file without regard to word breaks. So, I have a 1024 wide image interpreted as 1025 pixels wide, pixel 1 of line 2 is showing up at the end of line 1, pixels 1 and 2 of line 3 at the end of line 2, and so on. By the time you get halfway down, lines are being wrapped close to the middle of the line, explaining the image being cut in half with the halves on opposite sides. As the images are meant to be square and each line is shifted one pixel more than the previous line, that would explain the 45-degree diagonal tangent, and the circle being sheered into an ellipse… and optipng would of course throw an error if the input ppm is just missing the last line of pixels the resolution says should be there, though apparently, optipng isn’t coded to report unexpected end of file like it is for extraneous data as its reported when I’ve fed it images where my calculated resolution was less than the amount of pixel data I generated. At least, that’s my best guess as to what’s happening. And now I’m wondering if I can get an unsplit, sheered ellipse by applying some y-dependent offset to x before squaring x.
And another illustration of ascii ppm’s lack of structure, if I took a properly written ASCII ppm and cut and paste the red value of the first pixel to the end of the file, that would make every pixel’s green value its red value, every pixel’s blue value its green value, and every pixel’s red value the blue value of the pixel before it, and the red value of the first pixel the blue value of the last pixel… and now I kind of wonder what that would look like… I remember playing around with filters that swap color channels back when I could see, but this would be like swapping color channels while sheering one of the channels, so kind of superimposing 2/3 of a normal image with 1/3 of its sheered version… and imagine an animation of doing this repeatedly… might need to scale down since looping through an array with millions of ints millions of times sounds a bit ridiculous(though, I suppose a triple for loop with over a thousand steps at each layer is a bit ridiculous as well)… I’m starting to feel like I should be taking a page out of Matt Parker’s book and saying I wrote some terrible C++ code when it comes to describing how I generate these bits of programmatic art(none of the ones I’ve shown off involve arrays, I’m writing calculated RGB triplets to file every iteration, but if I wanted each frame to have the same pixel data, just with this shift applied, it would make sense to store the data in an array instead of calculating, writing to file, and discarding like I’ve been doing.
I’m almost positive that will parse as x is less-than positive 20: not a single operator, but less-than followed by a unary plus operator…
Yep, the most rarely-used operator in C (a bit less so in C++): unary plus sign forces a cast to numeric and widens the result to the size of an int. There’s basically no reason to ever use it except to make lists of positive and negative numbers line up nicely. So x <+ 20
just means “x is less than 20”.
In C++ it’s slightly more useful because you can overload it. But most people still avoid it.
We’re kinda off-topic for this thread, but it’s most likely that <+
is just a typo for <=
since plus and equal are on the same key of a qwerty keyboard…
Got the job! I’m 1/416 for obtaining a job interview but 1/1 in interviews which is honestly kind of an impressive statline. I’ve also got an opportunity coming up to talk with an even more exciting program to work towards full certification. For now, paperwork and orientation stuff. I’m really excited to be working and incredibly relieved that i can help out more than superficially with household finances. And, maybe a little selfishly, I’m ready to stop stressing myself out and get back to making things.
Yeah, <+ was a typo on my part, but this was a case where the resulting logical error had an interesting enough effect to make me want to figure out what the wrong code was actually doing and not just how to fix it.
Though, I have since fixed the typo, recompiled, and undergone the multi hour process of executing the code, converting the generated ppms into png(this time without needing optipng’s --fix flag) and compiling the individual frames into an animation:
Also did the shift the first subpixel value to the end of the file experiment on what I believe is the frame where the gradient circle is at its largest:
Which thinking about it some, switching the green channel to red and the blue channel to read should generate a gradient circle that goes from black to green to yellow and shifting the red channel onto blue of the previous pixel should result in the sheered ellipses that have a solid blue rim and a blue to black gradient in the middle… and off course, there is going to be color mixing where the two patterns overlap.
Also, scrubbed the bathroom counter top today, possibly the first time its been done since we moved into this trailer and it wasn’t nearly as hard as I expected and hasn’t agitated any of my aches and pains despite having to bend over quite a bit to reach said counter top. And that’s after doing the dishes yesterday without it agitating my lower back nearly as bad as it usually does. My most recent weigh in had the scale unable to decide between 320 and 319, but I think my weight loss over the last ~19 months is starting to show tangible benefits in putting less strain on my lower back and joints.
Very pretty gradient, now in circle form!
While moving data off my old laptop, I stumbled on my stash of writing I was working on before I got sidetracked into IF. It was better than I expected.
I only know the music version of this, but it’s super validating when it happens.
Thanks to some help from a generous stranger and after spending all day dealing with walmart.com glitching out in the check out process, I have a grocery delivery scheduled for tomorrow morning.
Also, three days eating nothing but rotini and rice hasn’t been as bad as I expected… Still looking forward to having beans to go with the starches again though.
I feel your pain. My SS hits my bank account on the 3rd Wednesday each month, depending on the calendar, it can be a long three weeks.
Somehow my AARP/UHC medicare supplement charge went up $60 per month THIS month. Yikes. It is funny how they can raise the monthly rate both at the beginning of the year and in July. This is the 3rd year in a row they have done that.
On a good note, my beautiful wife and I work together to make everything work. I’m 74 and she is still 29…
My SSDI comes in on the 4th Wednesday of each month and my food stamps on the 15th, so I frequently find myself buying things in supplies that last at least a month… but damn is that 35 minimum order even for grocery orders going to be annoying going forward, especially in cases where I already have enough in stock on pay day to reach the 15th of the next month, but not enough to reach the next payday and the issues with storage that arise from restocking early(I buy dried pinto beans by the 20 pound bag, and that fills my storage bin for beans to capacity, a 20 pound bag of beans is big, bulky, and hard to find a place for if I’m forced to restock when there’s more in the bin than can fit in a Tupperware, and compared to smaller bags, the 20 pound bag is like getting 5 pounds for free, so I want to buy the big bag whenever possible… thankfully, with a fresh 20 pound bag of beans in my bean bin, I should be good until the end of August even with there being a dreaded fifth Wednesday this month… Also learned today that 8 pounds of sugar is too much for a gallon ice cream tub turned sugar bowl. But yeah, I should be good on sugar, spice, beans, and rice for the next month and I get paid just in time to restock my tea chest(another potential pain point with Walmart robbing me of flexibility asfully stocked, my tea chest holds an 80-day supply, and 8 boxes of tea takes up quite a bit of space).
Anyways, I’ll be about time for me to take my rotini and beans out of hte rice cookers when I finish writing this post, and appropriately enough for having pinto beans to add to my pasta for the first time in 3 days, my rotini is chicken taco flavored today.
neutral thing: I’m kicking myself for being sit not only on a solution, but on an elegant solution on multiple interlocked narrative issues.
very positive thing: trivias are definitively useful, not only for puzzles, but also for plot & narrative.
Best regards from Italy,
dott. Piergiorgio.
Feeling better after 2 days actually having beans to add to my meals.
Also, caught up on all the serialized fiction I’m following on the Internet.
Also put together another piece of programmatic art this afternoon, this one inspired by the triangle inequality(for any 3 lengths, for them to be valid for he sides of a triangle, each length must be less than the sums of the other two). Interpreted this for the piece by setting the red value to the absolute value of the x coordinate minus the absolute values of y and z and doing similar with y for green and z for blue. If I’m not mistaken, x,y,z triplets that can form valid triangles or where one side equals the sum of the other two are black while triplets where x is too big will be red, where y is too big green, and z too big blue, with the brightness corresponding to how much the inequality is violated. No idea what shape this generates for the black region.
https://sightless-sanctuary.net/Graphics/Programmatic/Triangle%20Inequality.png)
It seems to make an X shape, with the intersection taken up by a diamond-shaped gradient!
This was really cool to look at! The central blue diamond sits in a black void, and begins to shrink. From the sides, half-diamonds (green and red) begin to creep in, as the central diamond shrinks and fades. A black X-shaped region appears, as the diamonds from the sides close in. For some reason, watching this made me feel really nostalgic!