25. Slim, Fats, and Shorty Walk Into a Stable
The old historical building which had housed the Taarna offices was gone, victim of a fire. Fortunately we had off-site backups of our software.
During the interim, while new facilities were found, I worked from home, doing what I could on my trusty Powerbook 170 laptop.
I had been keen on using our software to make some short films, both as a proof of concept of our approach, and also because I thought it would be fun. I had developed a trio of characters, named — perhaps rather unimaginatively — Slim, Fats, and Shorty. These characters appeared in three short screenplays I had written: “Poker Face”, “The Boxer”, and “Fair Attraction”.
The stories were inspired by the Looney Tunes shorts and Charlie Chaplin films which I loved. They were silent films heavy on slapstick and visual gags.
Not being able to work on our 3D graphics software on my PowerBook, I instead refined these screenplays, as well as writing a number of “fade-out” style 60-second interstitials featuring Slim. These were surreal scenes meant to be used as fillers on TV stations.
Our new offices remained in Old Montreal, in a beautiful old stone building which had been built as stables back in the (I assume) 1600’s or 1700’s. This location had enough space for a motion capture stage. We evaluated and used a number of early magnetic systems such as the Flock Of Birds and Polhemus systems.
I remember Pierre Lachapelle, the owner of the company, telling me at one point that the fire had accelerated his expansion plans. We were now in larger offices, and began ramping up by bringing on board and training artists to use our in-house tools.
“The Boxer” was chosen as the first film to produce.
Design & Code
I decided to revisit how I had implemented particle systems in my code. The class particle-animator
had been implemented as a subclass of animator
and would create a new instance of the shape
class for each new particle it spawned. This seemed wasteful and not very elegant.
Particle systems are an interesting case to consider when designing your classes. They have behavior (animator) and also geometry (shape). So I decided to try something I don’t do much of: multiple inheritance.
The new particle-system
class inherits from both polyhedron
and animator
, as you can see in the code snippet above. The class implements an update-animator
method as do all animators. And I decided to use the polygon (faces) structure of the polyhedron class to encode the particles and their trails, as seen in the draw-faces
method.
Perhaps I should mitigate any confusion due to the overloading of the use of the faces
slot by writing new particle-system specific accessors, but I have not done so yet.
So far I am satisfied with the tighter (and cleaner) coupling of the geometry and behavior stemming from the use of multiple inheritance, and have not seen any drawbacks.
Finally, just for the fun of it, I wrote a function which emits particles from the vertices of a polyhedron. See the final defun in the above listing. I also use the vertex normals to initialize the particle velocities.
This is not unlike the “guide hairs” technique I spoke of in a previous posting on hair generation for 3D characters. To make a hairy teapot, the next step would to fill each triangle with curves interpolated from the guide hairs at each vertex.