Movie Magic: The Mathematics behind Hollywood’s Visual Effects
When making his 1937 film Snow White and the Seven Dwarfs, Walt Disney presented his animators with some curious exercises. The sack-of-flour-exercise, for instance, asked artists to draw sacks of flour exhibiting various behaviors and moods: a cocky sack of flour, a dejected one, a sack of flour throwing a tantrum or having a laugh. Disney wanted his animators’ work to capture emotion and tension, yes, but also to reflect physical realities like inertia and gravity.
Animation is computerized now, of course, but the studios that bring us the likes of Cars, Frozen, and Ice Age still want their storytelling to be supported by an underlying semblance of physics.
“And that’s great for people who love mathematics,” Eitan Grinspun (Columbia University) told his Carriage House audience on March 1, “because to incorporate all the physicality on the computer you get to do a lot of fun mathematics.”
Grinspun began “Movie Magic: The Mathematics behind Hollywood’s Visual Effects,” part of MAA’s NSA-funded Distinguished Lecture Series, far from the twenty-first century California of the talk’s title, with Kepler (1571-1630).
Kepler’s Second Law of Planetary Motion, which states that a line between the sun and a planet sweeps out equal areas in equal times, was first proved by Newton (1642-1727), in his Principia. Newton’s proof was a discrete one—it assumed that the sun exerts its influence on the planet only with each tick of an imaginary clock—and, as such, can be readily interpreted as instructions to a computer for how to simulate planetary motion. Indeed, Grinspun said, an algorithm based on Newton’s proof produces a simulation that maintains an elliptical trajectory over arbitrarily long runtimes—with computation times 100 times better than a competing algorithm.
Is it a problem, though, that the simulated orbit doesn’t exactly track the analytical trajectory of the planet? Not if you’re only interested in modeling qualitative behavior, as animators often are.
“When we’re talking about visual storytelling,” Grinspun explained, “we’re not trying to predict the weather. We’re not trying to tell you it will rain at 5pm or 5:15pm.” Precision isn’t needed when depicting hair or fabric onscreen; it’s necessary only to replicate the gist, “the thing that says, yes, this looks real.”
If Polynesian heroine Moana’s tresses looked stiff or rigid, their relative immobility would distract viewers from her story; as long as they cascade realistically enough to avoid notice, the animators have done their job.
Newton’s proof of Kepler’s law thus illustrates three main themes of Grinspun’s talk: (1) the connection between physical systems and geometrical descriptions of them, (2) the use of discretization to facilitate efficient computer simulation of smooth phenomena and (3) the ability of such simulations to meet the realism needs of modern moviemakers.
Though invaluable to Grinspun and his colleagues at the intersection of mathematics and computer graphics, discretization is not without tradeoffs; much is lost in the transition from a smooth setting to a discrete one, and decisions must be made along the way about which aspects of the smooth system to preserve, and how.
Grinspun does much of his movie work in a discrete differential geometry, one in which surfaces become point samples or meshes. Definitions of smooth quantities such as curvature break down here, and must be reformulated. But what properties of smooth curvature should the discrete formulation retain? Should, for instance, the Turning Number Theorem still hold?
“These are the kinds of questions we grapple with as we move from smooth differential geometry to something we can compute efficiently,” Grinspun said.
And Grinspun et al. have grappled successfully, adapting the likes of Élie Cartan’s method of moving frames and Sophie Germain’s characterization of the vibrations of plates to mathematically model twisting and elasticity. This work underpins the convincing fuzziness of Radagast’s woodland friends in The Hobbit: An Unexpected Journey, the authentic-looking drape of Rapunzel’s dress in Tangled.
Hair and fabric simulation has also found applications beyond Hollywood. The paintbrushes in Adobe Photoshop and Illustrator are powered by the technology Grinspun described in his talk, as are programs fashion designers use for catwalk previews and pattern tweaks. The mathematics that ensures tree branches in Jungle Book move appropriately as monkeys traverse them also underlies the training tools that teach doctors how to maneuver flexible needles around organs to perform biopsies.
Grinspun concluded his talk with the idea that fruitful innovation is expected to continue. “Every day people in the visual effects industry are looking to see what new exciting mathematics there is,” he said.
Sophia Merow is a freelance writer living in Washington, DC.