14. Don’t Interpolate The Matrix

Kaveh Kardan
3 min readApr 29, 2022

--

When I got into CG, I also got into the history of animation. I read up on Walt Disney, Tex Avery, Chuck Jones, Shamus Culhane, and others. I clearly remember thinking that once we were done developing all this marvelous software, a few friends and I could easily make an animated feature. Boy was I wrong. The complexity of animation far outstripped our modest software efforts.

So at Neo-Visuals rendering and GUI were well in hand. Next up: modeling and animation.

The White Whale we were (unrealistically) trying to land with our modeling technology was GM. For entertainment animation purposes, polygonal models were how shapes were constructed. But for GM’s car designers, the mathematical precision of spline curves and surfaces were required. And not just any old splines. They needed NURBS (Non-Uniform Rational B-Splines), and standards such as the much-reviled IGES (Initial Graphics Exchange Specification) format.

We never had the resources to make a full-fledged industrial design solution (and the hardware wasn’t ready either). But the lure of someone like GM buying hundreds of licenses for their car designers was enticing, if ever out of reach.

I was working on the animation software. The idea was to have interactive curves which controlled the interpolation of transform values (translation, rotation, and scale) of an object over time. I was having trouble with the transformation matrices. The animation did not look right when I interpolated matrices between two keyframes.

I remember a coworker was driving us to dinner at a Chinese restaurant we frequented, and I was thinking out loud, explaining the problem to him when the solution came to me: I should not be interpolating the transformation matrix; I should be interpolating the translation, rotation, and scale values and recomputing the matrix for each frame. I re-wrote the code the next morning and it worked like a charm.

During this time, I began designing an OO framework for C, based on Brad Cox’s book, which I named XForm. It was meant for a next-generation 3D system (which never came to pass). I also read up on and did some coding in SmallTalk-80 which I found to be wonderfully elegant.

But let me wrap up my Neo-Visuals adventures by telling you about the game “Timestoppers.” It was a game one of the artists and I came up with late one evening at the office. One player stands at the doorway of a room full of cubicles holding a cheap plastic stopwatch. He starts the stopwatch and throws it somewhere in the room. The other player, also in the doorway, must get to the stopwatch and stop the timer. Shortest time wins. My artist friend was a super-athletic former army man. He demonstrated that going over desks was faster than going around them. He won. I lost.

Design & Code

The image above is the result of multiple steps of procedural modeling, as the code listing demonstrates. A profile is swept along a path with some twist and taper applied, and the result is instanced 8 times with a rotation around the Y axis. Color to taste.

I want to come up with a more compact code representation for this type of sequential/nested operations, maybe using macros, and then explore the possibilities.

My idea is the have a representation which lends itself to genetic programming, which is something that has interested me since I read Karl Sims’ Siggraph 1991 paper “Artificial Evolution for Computer Graphics.”

P.S.

A reader pointed out what an exciting experience the Siggraph Electronic Theater was. I whole-heartedly second that. It was two hours of the year’s best CG animation, presented with state-of-the-art projection and audio. And in those pre-Youtube days, it was the first (and sometimes only) chance we had to see the animations. On many an occasion I walked out in a daze and on a high.

Next Episode

--

--

Kaveh Kardan
Kaveh Kardan

Written by Kaveh Kardan

MIT mathematics degree • wrote animation software used in “Jurassic Park” • software R&D lead on “Final Fantasy” movie • software dev on “The Hobbit” films