Musings, ramblings, rantings about technology, games, puzzles, and whatever else catches my attention.
Friday, February 5, 2021
Racetrack Update
Sunday, January 31, 2021
Genuary 2021 Day 31: "Oblique Strategies"
I like the idea of Brian Eno's cards for jarring your brain to be more creative, to get out of its rut. I found an online Eno Oblique Strategy oracle, and it told me:
"Don't be afraid of things because they're easy to do."
Which I played around with for a while. I remembered the old vector arcade Star Wars game that allowed you to select your level and get a bonus if you selected anything but the easiest difficulty. But no shame in playing on "easy". Some people prefer to experience the story.
So, I rendered my own version of the level selection screen, using my ray marcher. I added in some "reflection" operators, so the four X-Wing cannons are actually a single piece of geometry. The 3 Death Stars are, in fact, 3 separate items in the scene hierarchy.
I then rendered a starfield as 4 separate Bridson blue noise pointsets. I drew the different pointsets with different colors - I think this gives some satisfying clustering, and looks like a SF vision of how stars look, even if it's not realistic.
I then used my Hershey Font renderer to draw some text. I put in the Eno prompt to give the player some reassurance.
I composited the starfield, the rendered scene, and the text together in GIMP.
Tools Used: drawSVG, my ray marcher, GIMP, Hershey Futura L font
Languages Used: Python
Development Time: ~3 hours
Drawing Time: ~1.5 hours (for the rendered bits, negligible for the rest)
What's Generative Here: only the starfield. Everything else was done by hand.
Saturday, January 30, 2021
Genuary 2021 Revisiting the Penrose Tiles (Day 29)
I won't explain them here, (read the above linked page for more detail) but I'm using two different shapes of rhombuses, "tall" and "short". In the earlier version, my seed pattern was a "wheel" or flower shape made up of 10 "tall" rhombuses arrayed around a point at the center of the page.
I was dissatisfied with this for a couple of reasons:
- It's not "generative" enough - it's some natural origin of some pattern, lining up with the center of the page. Bleh.
- There's too much symmetry. Penrose tiles are supposed to be this magnificent non-periodic pattern, but sitting right at the center of the screen is a 5-fold rotational axis of symmetry. Bleh. Not just a rotational axis, but 5 different planes of mirror symmetry.
- My new generator wouldn't use a symmetric "wheel", it would generate all possible patterns of rhombuses coming together at a vertex, and choose one. Also, rotate it, which is easy.
- The new generator should also offset the center of the page, relative to the center of the "wheel". This is also easy. Indeed, my earlier Genuary code was repurposed from some earlier code where I was making laser cut jigsaw puzzles, and that code had an offset. I deleted the offset to make porting my old code to my Genuary codebase easier. Putting it back is not a big deal.
Zooming in (and subdividing to maintain approximately the same level of detail). The point of symmetry is still staring at me from the top-middle of the page, like the eye of Sauron, in the middle of the red spot on Jupiter. Checkmate.
- More "generative"? Check, I guess? I like the fact that my seed "wheel" has more variety to it. And I'm rotating and centering in ways that mean that the next one I generate will be somewhat different from this drawing.
- Less symmetry? Meh, let's give that a C. The rotational center is not at the center of the page, so that's good. I could actually modify the code to ensure that my recenter-and-zoom code moved the rotational center off the page, that wouldn't be too hard.
- Right now, the paths are sorted based on the x-coordinate (or "abscissa") of vertex 0 on the path. I had considered checking to see if the last vertex is lower in x, and if so, flipping, which for this drawing wouldn't do anything, as all the drawn shapes are closed (unless you're clipping off the edge of the page, but that's not important right now). What I could do, instead, is to find the minimum x for all the points on the path, and use that to sort. This would avoid a little bit of "swiss cheese" effect where I'm filling the page with things and some things almost entirely to the right of some other things draw first. This would fill more evenly
- Don't just sort on x, also sort on y. I don't think this would have a lot of effect, as floating point, it'll getcha 99.99% of the time. But if there were three paths with "the same" x value, maybe draw them top to bottom, rather than middle, top, bottom, or some other weird order.
- A variant on the above would be to bucket the paths in x, and then within a bucket, sort in y. This would work around the floating point issue where things aren't ever going to match their x coordinates exactly. I could even just round the (x, y) pairs to integers, and it'd be pretty close to this.
Genuary 2021 Day 30: Replicate a Natural Concept
I drew a double pendulum today, using some math pointed out by the Coding Train "Coding Challenge #93: Double Pendulum" video: https://www.youtube.com/watch?v=uWzPe_S-RVE
I recall at some point when I was in high school, knowing a little bit about the Mandelbrot Set and a little bit about chaos, thinking that a double pendulum graph would be cool to explore.
It's kind of cool to see how the red bob ("bob 1") is jerked around by the blue bob ("bob 2"), yielding non periodic motion, but it's surprising to me to see how smooth bob 2's motion looks; the path looks like a sine wave to my eye. It's probably a little sharper, but hard to tell.
Interesting direction to go with this: instead of just a single plot of x versus time, what if we had multiple configurations in parallel, and compress the pendulum x value into a color? So, maybe time would extend to the right in the image, and the image x would represent some continuously varying set of initial conditions.
Tools Used: drawSVG Python Library
Languages Used: Python
Development Time: ~1 hours
Drawing Time: ~2 minutes
What's Generative Here: the mass and length m1 and L1 are chosen to be 1.0 each, but the mass and length m2 and L2 are chosen randomly. Similarly the initial pose of the double pendulum is randomly generated.
Friday, January 29, 2021
Genuary 2021 Day 29: "Any shape, none can touch"
"Penrose Tiling"
Thursday, January 28, 2021
Genuary 2021 Day 28: "Use Sound"
"Clash of the Piano Rolls"
For this one, I took 4 MIDI files and extracted the note_on data using the "mido" Python library. I cut out a random 60 second portion from each, and plotted the notes. I also drew a line for Middle C, to help orient you.
The four songs, in case you can't read piano rolls, are:
- "Popcorn" by Hot Butter
- "Never Gonna Give You Up" by Rick Astley
- "Tarzan Boy" by Baltimora
- "Take on Me" by A-ha
I think my parsing of the Rick Astley song must be wrong; it looks like I'm never finding "note off" messages. Damn you, Rick Astley!
I'm curious to play around with making a markov chain out of the percussion tracks. There's a lot of little notes going on down there.
Tools Used: AxiDraw, Pentel .5mm pen, mido Python library
Languages Used: Python
Development Time: ~1 hours
Drawing Time: ~40 minutes
What's Generative Here: I picked a random ordering of 4 songs, and picked a random portion from each, and then drew the song data (in random colors).
Wednesday, January 27, 2021
Genuary 2021 Day 27: "Monochrome Gradients without Lines"
"Rubber Duck-lish?"
Tools Used: My ray marcher, AxiDraw, Pentel .5mm pen
Languages Used: Python
Development Time: ~1 hour
Drawing Time: ~100 minutes
What's Generative Here: The camera position, the orientation, and the basic geometry of the donut + spheres are all randomly generated. I then use a random blue noise pointset to sample that image for halftoning.
























