Look ma, no bubbles
KeithHandy posted in Coding, Generative, Pretty Pix on July 31st, 2007
Now that I’ve taken out the trash…

Strangest thing about my old auto-morphing code that I’ve had a couple of demos up for (also on youtube): it’s had an incredibly stupid bug in it all this time, that I would never have noticed if I wasn’t just staring at the code mindlessly. It was transitioning smoothly from picture to picture, but there seemed to be an excessive amount of white or light gray circular areas that would unnecessarily billow up before resolving to the next keyframe. Everything was working correctly except for there was this line of code that I copied and pasted and didn’t finish changing it the way I’d intended to, so instead of getting the data for a, b, c, and d, it was getting “b” twice and leaving “a” at zero.
The reason it didn’t totally cause it to malfunction outright? To interpolate, it takes the data from not two, but four pictures. The keyframe just before the current frame is called “b”, the one just before that is called “a”, the one right after the current frame is called “c”, and the one right after that is called “d”. So you’ve got a, b, c, and d, and the thing you’re filling in is somewhere between b and c.
The reason it uses info going that far back and forward is so that I can make the data curve as it goes along. It’s called a spline curve, when the computer sort of “improvises” a curve to fit an arbitrary set of points, and in order to know how the curve is shaped, you want to know where at least a couple extra points are beyond the ones you’re between. Well, since “a” was treated as though it were all zeros, it would come out of “b” at the right place but at the wrong angle. So the data would always have sort of an “upward lurch” at the beginning of the transitions, thus making all those white and light gray bubbles.
Here is a demo video of a transition sequence that works the way I meant it to.
(Is this the same Keith Handy guy that does the music, or am I at the wrong website?)

