Loxalot July 3rd, 2010

Last week I mentioned that I had a few improvements to make to Loxodromes. Here’s a video with the new changes; try to see if you can spot them when compared against last week’s video:

Finished? Here are the changes:

  • Loxodromes are now thickest in the middle, and taper at both ends, rather than tapering from full with at one end to zero at the other.

  • Due to the previous change, the audio pulses now start in the middle of each loxodrome, and spread out to both ends simultaneously. Consequently, the visual impact of the pulse is largest right when it starts, as each mirrored copy is right next to each other. As the copies travel down each end of the loxodrome, they get thinner, and a gap appears between them, reducing the visual impact. The net effect cuts down a lot on perceived delay between the audio and the visuals.

  • The particles have lower initial velocity, and their upwards acceleration is slower. This keeps the particles in the shape of the ribbon for a little bit longer, which gives a neat highlight effect. The slower acceleration and velocity also makes it seem a bit more like smoke.

I’m pretty happy with the appearance of the loxodromes, at least for the moment. What I’m still playing around with is the behavior of the particles. My goal is for the particles to behave similarly to smoke, but I have no idea if that’s feasible or not. We’ll see!

Evolutions: Loxodromes June 23rd, 2010

Every so often I like to indulge in some navel-gazing. I have a bunch of old images and videos of my Processing projects lying about, so I’ll load them up in chronological order to see how my projects have changed over time. This is interesting to me for what might seem like an odd reason: I have very few ideas.

I marvel at many things. The amount of my time I spend procrastinating on the internet exposes me to a lot of fantastic work, and whenever I venture out into nature I invariably come back humbled. Yet while these things often motivate me, they rarely inspire me. Ideas tend to pop into my head rarely, without rhyme nor reason, so each one that shows up I’ll milk for all it’s worth.

Let me give you an idea of what I’m talking about: I’ve been using Processing for a little over three years now, and in that time, I’ve had about five good ideas, which have produced about eight projects that I’m not embarrassed to show people. That’s a rate of a little under two ideas and three un-embarrassing projects per year. Furthermore, I consider almost none of those projects “done.” (Incidentally, I have even fewer basic techniques than projects or ideas, but that’s a topic for a future post).

Here’s a concrete example: I first had the idea for Loxodromes in the fall of 2008, and in the roughly eighteen months since it’s grown into two visualizers. There were a couple of roughly month-long periods where I stopped working on them completely, due to school, but this has been one of my main Processing projects for a pretty long time. I’d say that on average, I put in about five to ten hours a week on my Processing projects, so this has probably seen somewhere close to 250 hours of work on it.

Let’s take a look at how it’s evolved, starting from the beginning.

Primordial

What prompted Loxodromes was seeing a basic ordinary differential equation solver my friend had whipped together. He tested it out by plugging in the formula for circular motion, and soon had a bunch of little white arcs carving their way across his screen. I liked the effect, and naturally, my inclination was to knock it up a dimension. Since I know little about differential equations, I implemented it by converting spherical coordinates to cartesian. After trying a few things, I happened to come up with loxodromes accidentally, and liking the shape, I committed to it.

Eukaryotic

The line effect was cool, but there wasn’t a whole lot going on, and the screen was mostly black. I tried making the lines thicker, but it didn’t do a whole lot to increase the visual complexity. Eventually I hit upon the idea of turning the lines into flat ribbons that tapered and faded down their length.

Prokaryotic

This is a variation I ended up scrapping. At first I thought it was a big improvement, since it’s more complex than when all the loxodromes have the same radius. After a while, I decided that the effect is more visual noise than anything—in the end, the coherence that comes from having all the loxodromes appear to share the same sphere is better.

Animalian

I’ve finally succumbed to my usual habits and tied audio into this thing. I like how the loxodromes are uncovered when the bass beat runs down their length. Unfortunately the bands of equal brightness (that come from not interpolating the FFT values) is kind of ugly, and it’s kind of boring without colors.

Chordatean

Now we’re starting to get somewhere. Adding colors and smooth interpolation along the loxodromes really spiced it up.

I’ve switched to using textured quad strips for the loxodromes, in order to get better anti-aliasing along the boundaries (my graphics card only supports 2x anti-aliasing). Unfortunately this has the side effect of creating an unsightly dark outline when one of the loxodromes overlaps another.

The glow on some of the loxodromes looks pretty good when they’re off to the side, but I don’t like how you can tell they’re just a textured plane when they move to the center of the screen. While they behave nicely when there’s a good beat going, if there’s no strong rhythm in the bass channels of the FFT, then they often just stick on full brightness for a couple of seconds, which looks odd and destroys the sense that the behavior is linked to the audio.

Vertebratean

Unsurprisingly, textures are much more interesting than flat colors. I’m pretty much happy with the appearance of the loxodromes now.

The glow is a different matter. Adding texture to the lines makes it harder to see how the glow is flat when it passes over the middle, but they still just look a bit boring, especially now that the loxodromes have an interesting texture.

Craniatean

Substituting the globes for particles (thanks, flight404!) really kicked this up a notch. I’m really satisfied with the visual portion of it now.

However, the behaviors a little bit off. Since the audio starts at one end of the loxodrome, the period where a given event in the audio starts to have maximum visual effect is delayed about a quarter second. The particles are a little more responsive, but there’s still about a 2-3 frame (66-100 ms) delay, which is definitely noticeable.

I do, though, have an idea for remedying this. I’ll be working on it for the next week or so, and posting an update about it shortly thereafter.

Aperiodicity May 23rd, 2010

This blog is named after one of my favorite areas of Mathematics. An aperiodic tiling is a specific arrangement of a given set of shapes that covers an infinite, two-dimensional plane without translation symmetry. This means that the tiling never repeats itself, while still covering an infinite amount of surface area.

To me, the mere fact that aperiodic tilings exist is pretty cool. Taking only a finite collection of component parts, you can produce something that is infinite, and infinitely variable. However, it turns out that most sets of tiles allow aperiodic tilings. As an example, consider the set of tiles consisting of 2x1 rectangles and 2x2 squares. This set allows an aperiodic tiling, since in the construction of a tiling, every time you need to place a tile, you can place either the square or the rectangle. If, at any point in the construction, the tiling is in danger of becoming periodic, just place the “wrong” tile down.

Interestingly, there are sets of tiles which only allow aperiodic tilings. The first such set of tiles to be discovered arose from the research of the logician Wang Hao. Note that, while Wang had an undergraduate degree in Mathematics, his masters was in Philosophy, and his doctorate in Logic, an area of study which Philosophers and Mathematicians have been fighting over almost since its inception. This is another reason why I find aperiodic tilings so fascinating—they’re a simple geometrical concept that happens to encode a form of the Halting Problem.

Wang Hao was researching the Domino Problem. Succinctly, the Domino Problem is the question of whether a given set of square tiles with colored edges can tile the plane such that only edges with the same color touch. Wang showed that the Problem can be solved by an algorithm (a simple set of instruction) if and only if there did not exist aperiodic tilings of the tiles. Wang thought that there was an algorithm for the problem, and hence, no aperiodic tilings, but his student, Robert Berger, proved that such an algorithm could not exist [1], and provided, somewhat offhandedly, a set of 20,426 tiles which was aperiodic.

Since then, several mathematicians have come up with sets of aperiodic tiles that are a bit simpler than Berger’s original set of 20,426. Perhaps the most widely known sets are the Penrose tilings, named after their discoverer, Roger Penrose. My favorite Penrose tiling is the P3 tiling, also known as the “Rhombus Tiling.” It consists of the following two tiles:

The Penrose Rhombus Tiling

The arc and dots produce matching rules, since tiles must be placed so that adjacent features have the same color. Now, instead of needing 20,426 different kinds of tiles to create an aperiodic set, we need only two. This is very pleasing to the intellect, since two is the lowest possible number of tiles that could make up such a set (it would be difficult to create a tiling of a single shape which never repeated).

All three types of Penrose tilings share a few remarkable properties. Take a look at the following ratios of sides to diagonals in the Penrose rhombi:

Ratios in the Penrose Rhombi

Where the phi you see above stands for the golden ratio. The reason the golden ratio shows up in these rhombi is because they are constructed from a pentagon, and the ratio of side-length to chord-length in a pentagon is golden. Similarly, the ratio of thin to thick rhombi in the P3 tiling approaches the golden ratio as you add more tiles.

Neat mathematical properties aside, the P3 tiling is just plain pretty.


Ratios in the Penrose Rhombi

Anyways, I hope you’ve enjoyed this brief excursion into mathematics. While most of the content of this blog will be focused on my digital artwork and electronics projects, I’ll probably write a few more posts in this vein, especially once school starts up again.


References

  1. Berger, Robert (1966), “The Undecidability of the Domino Problem”, Memoirs of the American Mathematical Society 66.
tags: meta, math, geometry
< older posts