I really went to town with Escher’s work, and tried to understand the math behind one of his drawings, “Prentententoonstelling” (“print gallery”).
I studied it (the method is described here), and tried to find a way to recreate such deformation with Mathmap, a command line application which deals with image transformations. Mathmap is also compilable as a Gimp plugin, but unfortunately it doesn’t work with the current version of Gimp (I’m using GIMP 2.2.10, which still works with the mathmap plugin).
Another feature of mathmap is the possibility to generate source code for a blender sequencer plugin, so here is the source code for the “Escher’s print gallery” blender plugin. It works both with still images and animations.
The code isn’t mine (although I was very close to having the solution):
this is a grafical representation of the steps involved in the transformation:
basic image
unwrapped image (logaritmic function which maps radius to x and angle to y):
tiled:
rotate the image so that the diagonal becomes vertical (I’ve no pics for this step)
.no pic.
and finally re-wrap the image:
I’ve found the complete algorithm published in a forum by Tie. (there are also beautiful images of “esherized” flowers).
My contribution to the cause has been to create the blender plugin, with the possibility to change every parameter.
Download the source file: read the next post for the updated version.
Plugin compilation
windows: with lcc
linux: copy the source file to the plugin dir, ( i.e. blender/plugins/sequence/ ) run make or cd to /blender/plugins and run bmake (if the script doesn’t find the plugin.h header, edit the file bmake, by removing the code which tries to find the plugin.h header with (edit the path accordingly to your system)):
INCLUDES=-I/path/to/blender/source/blender/blenpluginapi/
Plugin
Plugin usage
x pixels: [1 to 4096 px] width of the image (the size isn’t detected automatically).
y pixels: [1 to 4096 px] height of the image
Radius 1: [0 to 0.25] 1st “radius” (after some tests I’ve found that values greater than 0.25 are not so useful)
Radius 2: [0 to pi] 2nd “radius”
Strands: number of converging spirals.
Offset: angular offset between strands (strands must be > 1)
And here are some images made by me:
and here is the italian forum where we discussed the problem.