Making things move, part 5

If we apply procedural animation to iGor naively — by just adding time-varying noise to the rotation of the eyeball, the result is a sort of zombie eyeball, or perhaps an eyeball doped out on some serious medication. Its gaze appears to wander aimlessly, as though there is no focus or intentionality at work. Click on the image below to see what this looks like:

Of course the prospect of a zombie eyeball raises all sorts of interesting metaphysical questions. For one thing, does a zombie eyeball feed upon the brains of other eyeballs? Alas, such questions, while very important, are arguably beyond the scope of the current discussion.

Making things move, part 4

In a way, synthesizing procedural animation is a lot like synthesizing music: you create signals, and then you run those signals through filters to give them character. This is how we will animate our little eyeball friend — I guess we might as well call him iGor. 🙂

To make iGor look around, we need to synthesize a signal that will create a sort of unpredictable yet purposeful movement — as though he is looking at various things around him. To do this, we will need two tools: noise and gain.

The noise signal is the same noise I created to make procedural textures, except that we will vary this signal just over one dimension (time), rather than three dimensions (space). Noise by itself is rather flavorless — it just creates a signal that goes up and down over time smoothly but unpredictably:

But you can then shape this flavorless signal in different ways to get what you want. In our case, we want iGor to appear purposeful, so we will add gain to the noise to make it move more decisively: When the noise signal goes up, it will go up faster, and when it goes down, it will also go down faster. The more gain we add to a character’s movement, the more decisive that movement will seem.

You can see how this works by clicking on the image below to run a Java applet:

As you play with the applet, try varying the value of gain. You will see that after the gain filter is applied, the range of values stays the same. But the high gain noise signal spends more time near its lowest and highest values, and less time near the boring middle values.

Making things move, part 3

Procedural animation is a form of art more than it is a form of technology. You assemble some powerful tools, but the way you use those tools is more like playing an instrument than it is like assembling a machine. The entire purpose of the tools is to provide lots of little knobs and buttons so that you can use your own aesthetic judgement, and understanding of human behavior/perception, to create a compelling illusion.

In the case of an “Eyeball with personality”, our goal will be to create the convincing illusion that there is a mind controlling the movement of the eyeball. Two things make this task easier than it might otherwise be: (1) We only need to move the eyeball along two axes (rotate in longitude, and rotate in latitude), and (2) We don’t need people to know what the eyeball is thinking — we need only convince them that it is thinking.

This last point is crucial, and it’s one of the things that makes procedural animation work. If you create a convincing illusion that there is a personality at work, people want to believe, and so they will suspend their disbelief. It’s the same thing that makes us care about Elizabeth Bennet and Mr. Darcy, even know we know full well that they exist only as words on paper.

In particular, we never quite know what Elizabeth Bennet will do next — Jane Austin builds a nice sense of unpredictability to this headstrong character. But it’s a controlled predictability — the character’s actions may be unexpected, but they take place within a set of constraints.

Going from Austin to Eyeball, tomorrow we will start with controlled randomness.

Making things move, part 2

With an eye to following the Frankensteinian theme suggested by some readers of yesterday’s post, I will use an appropriately creepy subject for talking about procedural animation.

Clicking on the image below will take you to a java applet showing a 3D model of a human eye. We’re going to bring this little critter to life over the next few days. Meanwhile, interacting with the java applet will let you see how the model was put together.

Nothing in the 3D model was actually measured from life. As I will do in each step of this little project, I just eyeballed it. 🙂

Making things move, part 1

I first started developing procedural textures as a way to make things look more natural in computer graphics. These days, much of stuff of fantasy you see in movies — the marble, fire, smoke, clouds, stone, water and all sorts of other things — are built from such methods.

I remember how exciting it was for me back to when I first realized I could apply these same ideas of procedural and noise-based textures not just to appearance, but to animation. I’ve been trying to think of a very user-friendly way to describe how procedural textures can be used in computer graphics for making things move and come to life in a natural way — in a way that, as the master Walt Disney animators used to say, conveys the illusion of life.

More tomorrow.

Back home

Traveling around the world is fun, but then coming home again after a long trip is awesome.

I know I shouldn’t get so sentimental about this, but there is something simply wonderful about the familiar little things, even the annoying things. The temperamental coffee maker and its arcane rituals, the newspaper that arrives with a bang at my door every morning at 5am, the faucet in the shower that keeps falling off, the light in the entryway that still doesn’t work (I’ve tried).

And of course there’s that one side of the toaster in the kitchen that either doesn’t toast or else burns the bread to a crisp. I’ve never been able to find a pattern — it seems to operate from a random number generator. God I love it!

We each have our little daily patterns, the groove of seemingly meaningless physical details that help us properly orient ourselves for the day to come. There is something about the physicality of these things — their connection to our body in space and time — that creates a powerful bond.

I’m sure we will eventually create amazing places with augmented reality, limitless landscapes and virtual environments limited only by the imagination. Brave new worlds in which the toast comes out perfectly every time.

But I wouldn’t trade that toaster in the kitchen for anything.

No ryokan

I did a thorough internet search — or at least I think it was a thorough internet search — and I discovered that there are no ryokans in New York City.

I am surprised by this. The Big Apple generally never misses an opportunity, and yet it somehow is not exploiting this potential gold mine. Imagine the harried businessperson whose day is filled with meetings, appointments, things to do and people to meet. What could be better than the knowledge that one could retreat into a perfect oasis, a refuge of zen-like calm, casting off the shackles of modernity, for at least an evening, and partake of a timeless sense of peace?

I wonder whether some enterprising hotelier, upon reading this, will think “Aha!, that’s just the thing!”

After all, when I told a friend that I went to a Ninja themed restaurant here in Tokyo, she pointed out to me that there is also a Nina themed restaurant in New York City.

If our fair city can manage a Ninja themed restaurant, the least it could do is provide at least one ryokan for the weary traveler.

Ryokan

Whenever I come to Japan I stay at a traditional Ryokan. For anyone who has ever doubted the power of Feng shui, just stay a night in one of these places. The traditional tatame mats, beautiful proportions, simple yet elegant arrangement of the furniture and bedding, quiet artwork upon the wall and lovely natural muted color palette all conspire to create an extraordinarily tranquil experience.

And every morning, in a private room with traditional Japanese music softly playing, they serve me a feast of six dishes, accompanied by fresh steamed rice and green tea brewed at the table. Everything is arranged upon the table just so — soups made with three kinds of mushroom, all varieties of tofu, fresh greens and spinach, sour plum and miso, sliced apples, carrot tempura, exotic sprouts, natto, seaweed salad, all sorts of dipping sauces, delicate spices and, on occasion, just a touch of fiery wasabe. Every breakfast is different, and each one is perfection.

When I go back home, I wish I could take the Ryokan with me.

The ducks win

This weekend my hosts took me to Hama-rikyu Gardens. This tranquil and exquisitely verdant refuge in the middle of Tokyo is where the Emperor used to relax with family, and on occasion entertain foreign dignitaries.

One of the activities highlighted in our visit was the duck hunt. In order to easily trap wild ducks, the Emperor’s minions would train a duck to land on command in a specially built trench. When the local wild ducks saw the trained duck there, they would assume it was safe to land. At that point the Emperor would entertain the foreign dignitaries by having his servants throw a net over the unsuspecting ducks, trapping them. Mission accomplished.

I found this entire enterprise to be oddly unsporting. As I watched and listened, I kept wondering whether one of the trained ducks ever rebelled. I suddenly flashed on Star Wars, as I pictured the Emperor’s plans being foiled by a lone renegade duck, casting off his training and leading the other ducks skyward to safety. In my mind I could almost hear one of the Emperor’s minion’s saying, in a deep basso voice, “The Force is strong in this duck”.

As I walked around Hama-rikyu, I could see many ducks in peaceful repose, sunning themselves or floating serenely in the lovely ponds scattered about the gardens. They were now perfectly safe, their natural enemy the Emperor having long since been vanquished by the unforgiving winds of political change.

The ducks win.

The great Buddha in Kamakura

After an amazing gourmet lunch at Hachinoki, prepared in the traditional Shojin Ryori style, we went to see the great Buddha in Kamakura. Looking up in awe at this immense seated figure, rising over 13.4 meters in the air, I found myself thinking “if he moves, I’m leaving.”

And then it occurred to me — what if all the giant religious statues around the world came to life, and they weren’t friendly? What if all the statues of Krishna in Mumbai and Kolkata alit off their pedestals, reconnoitered in Nagpur and headed north to take New Delhi?

What if the great Buddha in Nara suddenly stood up, busted through the roof of the Todai-ji temple, and began striding with menace toward Osaka? What if Cristo Redentor in Rio de Janeiro became Cristo Predator, charging down the slopes of Corcovado to storm across the favelas and lay waste to the beach hotels?

I had this image of all the great religious icons of the world joining forces, teaming up to form an unstoppable army, in relentless and singleminded pursuit of a common enemy — us.

I soon came to my senses, as I watched tourists line up to pay two bucks a pop for the privilege of climbing inside the hollow bronze statue and peering out his torso. I realized the assault upon our race by marauding religious statues wasn’t likely to happen any time soon. Humankind would be safe after all.

Oh well, I thought wistfully, it would have been nice to see our great religious figures finally coming together for a common cause.