Anticanon

I set myself the challenge of bringing to life the famous woodcut, by the Dutch artist MC Escher, depciting ants walking around a Möbius strip in a figure eight. This brought together 3D animation, mathematics and the music of Bach.

Blender animation

Blender is the most amazing free open-source software for 3D animation. A thriving community has developed a huge range of functionality and a vast selection of free tutorial videos. I downloaded a free model of an ant with full armature that I could animate to create a walking motion.

A helpful video about generating mathematical objects using Python explains how to implement 3D transformations using 4×4 matrix multiplication. Using the tool at OTVINTA, I pasted the Python script into Blender to generate a Möbius strip, with an additional sine wave on the Z-axis to turn it into a figure of eight.

Blender makes it easy to force an object to track a path. Surprisingly quickly I was able to make an ant follow the centre line of the Möbius strip. I composed and recorded some etherial music to accompany a short video of the single ant (watch till the end!).

Pieces of Eight

I thought it would be relatively easy to add eight more ants to create a fully animated version of Escher’s image, but this is when my troubles began. In spite of watching loads of videos about using Blender’s geometry nodes to create a particle system of ants walking around the path, I was beset with endless problems. Blender simply couldn’t keep track of the normals of an unorientable one-sided surface. So the ants kept passing ghostlike through the Möbius strip.

Having worked on another project for a few days, I came back to the animation. After calculating the Y and Z angles of orientation of the ants, I was stuck with the X orientation, which determined how the ants negotiated the up and down motion of the figure of eight. Finally, I resorted to a clunky solution of recording the manually-adjusted X orientation at multiple intervals. Then I asked Copilot to obtain the two highest amplitudes from a Discrete Fourier Transform. This allowed me to model the X orientation with two sine waves.

This completed the animation.

Möbius canon

Douglas Hofstadter’s famous book Gödel, Escher, Bach, mentions Bach’s “Crab Canon“, in which one melody is superimposed on the same melody in reverse (a reflection in time). An internet meme falsely claims that the canon can be represented on a Möbius strip.

However, Eric Altschuler worked out that Bach’s Canon 5 from BWV 1087 can be written on a Möbius strip. In a canon, a first voice is joined by a second, singing the same melody with a delay. We can think of this in terms of mathematical symmetries as a translation over time. In Canon 5, Bach flips the melody upside down for the second voice (a reflection in space). The result is a called a glide reflection. Since this is the symmetry of a Möbius strip, the repeating part of the canon can be written on a transparent strip. Bach added two more voices to Canon 5, with the same properties.

If Bach can do it…

…why shouldn’t I? Well, it is not so easy to emulate one of the greatest composers of all time. My first attempt was a discordant cacophony. One problem is that, initially, it appears that there are 12 different ways to flip a melody upside down, because the starting note can be shifted to any of the 12 notes in the octave below, depending on where you position your mirror.

But by examining Bach’s score more carefully, we see that he flipped the stave upside down (not the keyboard). This means that the inverted notes stay in the same key. However, you still have to choose the correct mirror plane and avoid the jarring effect of playing adjacent notes in the two voices. I dealt with this by first composing a half phrase and then creating a complementary half phrase while the first half was playing on a loop. This also ensured that they remained compatible when they were both inverted to make the second half of the phrase. And just to match Bach, I did this again for the third and fourth voices.

I called the composition Anticanon. The clarinet introduces the four-bar theme, then the bassoon joins with the theme inverted and shifted by two bars. Two sets of strings play in the background with a simpler accompaniment of the same form. While only a feeble and pale imitation of the work of the maestro, it does possess similar properties.

An anty canon

And there you have it: a living animation of Escher’s ants, accompanied by a canon that can be written on the Möbius strip.

Sword in the stone

The project began by building the sword from scratch. Following a series of clearly explained steps, a basic cube was stretched and reshaped until it took the form of a blade. Adding a metallic material complete with subtle scratches and blemishes enhanced its realism. Clever use of mirror symmetry ensured that the handle and pommel were perfectly balanced. The handle was decorated a leather texture. In the next step the blade and pommel were imbued with light emitting runes.

The sword was embedded in some rocks designed to look like a plinth with two small steps. The rock were positioned to create leading lines towards the sword handle. A rocky background gave the impression of being inside a cave. This was achieved by randomly scattering rocks onto the tessellated faces of a partial hemisphere and fiddling with the density parameter.

Although Blender includes a range of particle simulators, this project used geometry nodes to create the flames, embers and floating particles, adding dramatic effect to the sword.

Having constructed the elements of the scene, considerable time was spent on lighting and volumetric effects, with the aim of creating depth and realism. For example, randomly positioning shapes, called gobos, in front of the spotlights created patches of light and shade in the beams, helping to highlight important elements, like the handle of the sword. Making the spotlights the children of their targets ensured that they moved synchronously. Another step, called compositing, was used to generate an ethereal vignette and adjust the colour balance between foreground and background.

The next step introduced cameras to create the final animation. Once the key frames were positioned in the dope sheet, Blender automatically panned the camera around the scene. Further spectacle was added to the setting by importing a free motion captured character from the fantastic Mixamo site.

Having completed the tutorial, I extended the animation, slowed it down to half speed and added some of my own music to produce the final video. One of the reasons for embarking on the project was to test out the power of the GPUs on my new MacBook Pro. It did not disappoint, rendering the entire video at lightning speed.

In a future project, I plan to experiment with Blender’s Python API.