A Tiger Made of Triangles

In a new documentary, mathematician Patrick Sanan explains the math and physics behind 'Life of Pi’s' CGI star.

May 19 2015, 12:00pm

Tigers are among the most formidable predators in the world, and they can be extremely dangerous even when they are raised in captivity. This reality posed numerous problems for the cast and crew of the 2012 film Life of Pi, which is about a boy and a tiger surviving in the very confined space of a lifeboat.

The crew used real tigers for many of the shots that didn't require direct interaction with lead actor Suraj Sharma, but because of the danger inherent in working with these magnificent carnivores, computer-generated animations of tigers were used for much of the film. As visual effects supervisor Bill Westenhofer succinctly put it in The New York Times: "We didn't want our actor to get eaten." Fair enough.

But how does a crew digitally reconstruct a real animal without verging too far into cartoon territory, as bad CGI so often does? In this case, the answer had to do with combining mathematics with physics—specifically, geometry with elasticity.

Mathematician Patrick Sanan was part of the team that worked on this problem, and in a new short documentary entitled "Tiger Math," he explains how the film's remarkably complex and lifelike virtual tiger was built from a mesh of digital triangles.

"Tiger Math." Credit: University of California Television/YouTube

"The tiger as a digital object, as opposed to something you see on the screen, is really just represented as a set of points, and a set of triangles inside the computer," said Sanan. "The point is that the triangle is really the simplest two-dimensional shape, and by working with those, you can simplify your task with working with a large complicated shape into the task of working with these small, simple shapes."

"This is called a mesh, and it's the fundamental data structure in a lot of geometry processing," he continued. "Everything you see is ultimately boiling down to triangles. Each triangle has a color, it has a position, [and] it can have other data attached to it, like how much hair is on it."

As Sanan points out, these complicated matrixes of triangles—combined with mapping techniques like surface parameterization—are entrenched staples of modern computer-generated entertainment (and computer modeling in general).

But in his own research, Sanan discovered that an entirely new level of detail could be added to the virtual tiger by combining these simple geometrical meshes with other physical principles.

"My contribution is taking the simplicity of geometry and marrying it with the physical rigor of elasticity," he said. "We can use that intuition to say we're going to solve this problem of making a map by pretending that the map is made of an elastic material. By formalizing the problem in this way, you can actually use efficient algorithms and physical intuition from a well-developed area of physics to help you solve this geometry problem."

This "elastic distortion" enables higher resolution of a simulated model's anatomy, be it a tiger or any other virtual object. It also allows CGI artists to figure out the most realistic behaviors possible for whatever scenes they are attempting to bring to life. In Life of Pi, the effect created a near-seamless transition between the shots of real tigers—which constituted only 14 percent of the film—and the ones starring the virtual tiger.

Screenshot from "Tiger Math." Image: University of California Television/YouTube

Obviously, this is great news for moviegoers who want to immerse themselves in more believable cinematic sequences. But it could also be a boon for animal rights concerns, which is one area in which the Oscar-sweeping Life of Pi apparently did not excel.

According to a leaked email from Gina Johnson, the film's American Humane Association (AHA) monitor, a tiger named King was almost killed on set during a particularly difficult scene.

"The worst thing was that last week we almost fucking killed King in the water tank," Johnson's email, which was exposed in a Hollywood Reporter feature, allegedly read. "This one take with him went really bad and he got lost trying to swim to the side. Damn near drowned...I think this goes without saying but DON'T MENTION IT TO ANYONE, ESPECIALLY THE OFFICE. I have down-played the fuck out of it."

A Fox spokesman denied that King was ever in danger, but the film's director Ang Lee has since confirmed that there was an accident, but that King survived without any lasting harm. Regardless of the details, Johnson promptly resigned from the AHA.

This close call is a reminder that the animals used in film and television occasionally put their lives on the line for our entertainment, and unlike human actors, they don't really get a say in it.

This is an issue that could be easily mitigated as CGI technology continues to mature, with the help of interdisciplinary experts like Sanan. Real-life animal stars can add a lot of charisma to a movie, but King's water talk accident is a great example of why dangerous stunts should be left to their digital counterparts.