Reverse engineered metamorphosis – Part I
So Glenn Marshall’s metamorphosis video has been getting some rave reviews lately. The video consists of a 2d recursive vine-like growth, lots of butterflies, and some nice finishing effects. It is very pretty.
Unfortunately, Glenn’s been a little – hmm – reluctant to share his code. That’s a pity, because, well, Processing is open source, and it’s helpful to the development community when the results generated with Processing are fed back into the system, allowing beginners to grab some pre-built examples, and veterans to compare notes and techniques. In Glenn’s defense, this seems to be his livelihood, and I imagine he’s hesitant to go open source with us because he’d like to ensure that he gets his just rewards.
Well of course you know where I’m going with this. What better challenge than to reverse engineer such a lovely animation. Glenn is a self-proclaimed beginner in Processing (although you certainly wouldn’t guess it from the results). I am a (now) self-proclaimed non-beginner-non-veteran in Processing, so to add to the fun of reverse engineering this thing, I’m going to up the ante and say that the final result must:
- Run in real time. Let’s say a minimum of 15 fps on my good desktop. (Glenn notes that it took 4 hours to render the HD version.)
- Not look like Glenn’s creation. I don’t want to infringe on anyone, so no lookalikes, but the result must have the same basic elements: a meandering camera, a recursive vine-like growth sequence (not unlike my Lettertree tutorial), some layering, maybe a particle system or two, and some interesting background noise. No butterflies… I’m not a big fan.
- Be OOPed on top of my existing base classes.
- 6 hours total work time on this.
Today I’m posting my first dabble. The source code is structured similarly to the rest of my tutorials. I was able to quickly get the springy camera and “stalk” of the vine working, which by the way is not unlike Yellowtail, minus the user input and cool motion.
I’ll get into depth and code at a later date. For now, here are some bullet points:
- The stalk is essentially just a springy Polyline, eternally chasing a random Point, which moves every time the stalk comes within a certain distance (see the variables at the top of the Vine class). The Polyline is limited to a configurable number of sub-Segments… thus the disappearance of its tail.
- The trickiest bit to this first attempt was simply to make the stalk’s “tails” to look nice, and do that cute little growth thing. The variables relating to that are of the “th” variety in the Vine class.
- Notice that there’s no recursion yet, but that will just be a matter of adding children to the Vine class.
- The camera movement is super basic: a very-low-dampening spring with a very slow chase rate… giving it that “oh my god, I can’t believe I have to keep chasing this point, I’m so tired” feeling.
- Remember that since most of my core classes rely on 3d coordinates, I’m limited to rendering in OpenGL or P3D… which means that the smoothing won’t be quite as slick as in the original.
Here’s the source code. And finally… the results!
Enjoy. Feedback welcome. Stay tuned for part two. Oh an I wasn’t lying the other day about a good Particle tutorial coming up… I’ve got it written up, but am working on a few examples to accompany it.
Chris wins

The omnipresent Chris has (politely) reminded me to stick to tutorials and things that I know. He is right. Tonight: bike ride, dinner, then getting a particle tutorial together. Stay tuned.
And in the meantime, enjoy this image from Married to the Sea.
Fixed
Oops. I hadn’t noticed that the inline code blocks were displaying incorrectly since I upgraded a plugin. I’ve reverted to the old version of the plugin and vow to never update anything ever again. Sorry about that.
Domain squatting
I’ve posted almost nothing productive on this blog in months! Just ranting! Let’s keep it up. Today’s topic: domain squatting, a.k.a. domain parking.
I’m a bit of a word lover. I enjoy certain combinations of words. This interest, combined with my web-oriented skill set, has made me into a bit of a domain name speculator. I occasionally think of words that might make nice domain names… and every once in a while, I buy one. Angel always complains that I do this instead of, for example, taking her to the movies. In my defense, buying a domain name is cheaper…
Moving on.
Domain name squatting has been a major problem since the mid-late 90s, the formative years of the internet. Back then, large companies that originally hesitated to build a web presence often found that their ideal domain name was registered by some clever nerd who would subsequently extort the company for a couple grand in exchange for the rights to the domain name. Not a huge deal. And the feeling amongst nerds was… well… you snooze you lose.
Lately, however, domain registrars such as GoDaddy have been registering domains in bulk. Literally taking entire pages out of the dictionary (challenge: find a word in the dictionary that does not exist as a registered domain name… and register it!). Registration costs as low as $7/yr… so a company like GoDaddy can register 10,000 domains–5% of all English words–for a pretty low price.
The strategy that these large companies have concocted is as follows: register as many domains as possible, throw some ads on them to recoup the cost of the registration, then auction the high-request-traffic domains to companies that have large enough budgets to pay 1,000 times the cost of a typical domain registration.
The problem with this “corner the market” strategy is that it is non-renewable. Extremely non-renewable. For two hugely important reasons:
- There are a finite number of words in the English language. Furthermore, there are a relatively small number of words in that set that are easy to spell and/or pronounce. New words are occasionally created, but not at a rate anywhere close to the rate of internet expansion. Eventually, we will run out of pronounceable and meaningful letter combinations. Of course, it is equally difficult to find an unregistered two- or three-syllable non-word (e.g. Google).
- When a domain expires, it is the registrar who has first pick on whether or not to grab the domain name for themselves. This is particularly important during times of “internet economy slump”… when small- and medium-traffic online businesses close shop and leave common-word domains lying in their wake.
Furthermore, it essentially squeezes small businesses out of the market by requiring those startups to settle for a less-than-memorable domain name, or put a large percentage of their funds into buying a memorable one.
In conclusion, domain name parking by individuals is fine (my favorite example); domain name parking by registrars is monopolistic and evil.
Take action! When you stumble across a parked domain, remember the registrar associated with it, and do not purchase any service through them. And please, don’t click the damn ads. If you want to do more, inquire about the domain, but in the comments box write something like “wouldn’t you like to work at a company that is not evil?” Maybe we can convince all their employees to leave.
Comments welcome, but I will bitch slap you if you disagree and call this “the nature of capitalism, the preferred economic strategy of God himself”. Fools.
Skeptic slap!
I read this conversation in the comments of this article about the LHC. It’s pretty great.
Skeptic: Just exactly how do black holes ‘evaporate’? Do they also exhibit this behaviour in outer space, and if so at what rate? Also what is the ‘unimaginably short period of time’ it will take for them to do so–a picosecond, a femtosecond?
Science: Hawking Radiation. In fact, if the LHC proves this, Stephen Hawking will probably finally get his Nobel.
The speed at which a black hole evaporates is inversely proportional to its mass. Macroscopic black holes trap mass much faster than they lose it from radiation, and thus persist. Quantum-size black holes (the ones from the LHC will be much smaller than even a proton) will evaporate on the order of a femtosecond.Skeptic: (referring to Hawking Radiation) So it’s not proven yet-
Science: The same theory which posits the creation of black holes also predicts evaporation due to Hawking Radiation. Thus, if you choose to be worried about black hole formation, you also have to accept the fact that they will evaporate. If you dispute that they will evaporate, no problem, because if that’s true then they won’t be formed in the first place. Either way, much ado about nothing.
Awesome! Sadly, the skeptics rarely concede defeat. (That is the difference between science and religion.)
The weather
I would someday like to have a job or a lifestyle that is in some way affected by the weather.

The article has
one response