Return to Video

Pixar: The math behind the movies - Tony DeRose

  • 0:07 - 0:09
    At Pixar, we're all about telling stories,
  • 0:09 - 0:11
    but one story that hasn't been told very much
  • 0:11 - 0:14
    is the huge degree to which math is used
  • 0:14 - 0:15
    in the production of our films.
  • 0:15 - 0:17
    The math that you're learning in
  • 0:17 - 0:18
    middle school and high school
  • 0:18 - 0:21
    is used all the time at Pixar.
  • 0:21 - 0:23
    So, let's start with a very simple example.
  • 0:23 - 0:27
    Anybody recognize this guy? (Cheers)
  • 0:27 - 0:29
    Yeah, so this is Woody from Toy Story,
  • 0:29 - 0:32
    and let's ask Woody to, say, walk across the stage
  • 0:32 - 0:35
    from, say, left to right, just like that.
  • 0:35 - 0:39
    So, believe it or not, you just saw a ton of mathematics.
  • 0:39 - 0:40
    Where is it?
  • 0:40 - 0:42
    Well, to explain that,
  • 0:42 - 0:43
    it's important to understand
  • 0:43 - 0:45
    that artists and designers think in terms of
  • 0:45 - 0:47
    shape and images
  • 0:47 - 0:50
    but computers think in terms of numbers and equations.
  • 0:50 - 0:51
    So, to bridge those two worlds
  • 0:51 - 0:53
    we use a mathematical concept called
  • 0:53 - 0:55
    coordinate geometry, right?
  • 0:55 - 0:57
    That is, we lay down a coordinate system
  • 0:57 - 1:00
    with x describing how far something is to the right
  • 1:00 - 1:03
    and y describing how high something is.
  • 1:03 - 1:05
    So, with these coordinates we can describe
  • 1:05 - 1:08
    where Woody is at any instant in time.
  • 1:08 - 1:10
    For instance, if we know the coordinates of
  • 1:10 - 1:12
    the lower left corner of that image,
  • 1:12 - 1:14
    then we know where the rest of the image is.
  • 1:14 - 1:16
    And in that little sliding animation we saw a second ago,
  • 1:16 - 1:18
    that motion we call translation,
  • 1:18 - 1:21
    the x coordinate started with a value of one,
  • 1:21 - 1:24
    and it ended with a value of about five.
  • 1:24 - 1:27
    So, if we want to write that in mathematics,
  • 1:27 - 1:30
    we see that the x at the end is four bigger
  • 1:30 - 1:32
    than x at the start.
  • 1:32 - 1:35
    So, in other words, the mathematics of translation
  • 1:35 - 1:36
    is addition.
  • 1:36 - 1:38
    Alright?
  • 1:38 - 1:39
    How about scaling?
  • 1:39 - 1:41
    That is making something bigger or smaller.
  • 1:41 - 1:44
    Any guesses as to what the mathematics of scaling might be?
  • 1:44 - 1:48
    Dilation, multiplication, exactly.
  • 1:48 - 1:50
    If you're going to make something twice as big,
  • 1:50 - 1:52
    you need to mulitply the x and the y coordinates
  • 1:52 - 1:54
    all by two.
  • 1:54 - 1:56
    So, this shows us that the mathematics of scaling
  • 1:56 - 1:58
    is mulitiplication.
  • 1:58 - 1:59
    Okay?
  • 1:59 - 1:59
    How about this one?
  • 1:59 - 2:03
    How about rotation? Alright, spinning around.
  • 2:03 - 2:06
    The mathematics of rotation is trigonometry.
  • 2:06 - 2:08
    So, here's an equation that expresses that.
  • 2:08 - 2:10
    It looks a little scary at first.
  • 2:10 - 2:13
    You'll probably get this in eighth or ninth grade.
  • 2:13 - 2:16
    If you find yourselves sitting in trigonometry class
  • 2:16 - 2:19
    wondering when you're ever going to need this stuff,
  • 2:19 - 2:21
    just remember that any time you see anything rotate
  • 2:21 - 2:23
    in one of our films,
  • 2:23 - 2:25
    there's trigonometry at work underneath.
  • 2:25 - 2:27
    I first fell in love with mathematics in seventh grade.
  • 2:27 - 2:30
    Any seventh graders? A few of you? Yeah.
  • 2:30 - 2:32
    My seventh grade science teacher showed me
  • 2:32 - 2:34
    how to use trigonometry to compute
  • 2:34 - 2:37
    how high the rockets that I was building was going.
  • 2:37 - 2:38
    I just thought that was amazing,
  • 2:38 - 2:41
    and I've been enamored with math ever since.
  • 2:41 - 2:43
    So, this is kind of old mathematics.
  • 2:43 - 2:44
    Mathematics that's been known and, you know,
  • 2:44 - 2:47
    developed by the old dead Greek guys.
  • 2:47 - 2:49
    And there's a myth out there that all the interesting
  • 2:49 - 2:51
    mathematics has already been figured out,
  • 2:51 - 2:54
    in fact all of mathematics has been figured out.
  • 2:54 - 2:56
    But the real story is that new mathematics
  • 2:56 - 2:58
    is being created all the time.
  • 2:58 - 3:00
    And some of it is being created at Pixar.
  • 3:00 - 3:03
    So, I'd like to give you an example of that.
  • 3:03 - 3:04
    So, here are some characters
  • 3:04 - 3:06
    from some of our early films:
  • 3:06 - 3:10
    Finding Nemo, Monsters Inc. and Toy Story 2.
  • 3:10 - 3:14
    Anybody know who the blue character in the upper left is?
  • 3:14 - 3:16
    It's Dory. Okay, that was easy.
  • 3:16 - 3:17
    Here's a little harder one.
  • 3:17 - 3:20
    Anybody know who's the character in the lower right?
  • 3:20 - 3:22
    Al McWhiggin from Al's Toy Barn, exactly.
  • 3:22 - 3:24
    The thing to notice about these characters
  • 3:24 - 3:26
    is they're really complicated.
  • 3:26 - 3:28
    Those shapes are really complicated.
  • 3:28 - 3:32
    In fact, the toy cleaner, I have an example,
  • 3:32 - 3:34
    the toy cleaner there in the middle,
  • 3:34 - 3:36
    here's his hand.
  • 3:36 - 3:38
    You can imagine how fun it was to bring this
  • 3:38 - 3:41
    through airport security.
  • 3:41 - 3:43
    His hand is a really complicated shape.
  • 3:43 - 3:46
    It's not just a bunch of spheres and cylinders stuck together, right?
  • 3:46 - 3:48
    And not only is it complicated,
  • 3:48 - 3:50
    but it has to move in complicated ways.
  • 3:50 - 3:52
    So, I'd like to tell you how we do that,
  • 3:52 - 3:54
    and to do that I need to tell you about midpoints.
  • 3:54 - 3:56
    So, here's a couple of points, A and B,
  • 3:56 - 3:57
    and the line segment between them.
  • 3:57 - 3:59
    We're going to start out first in two dimensions.
  • 3:59 - 4:01
    The midpoint, M, is the point
  • 4:01 - 4:03
    that splits that line segment in the middle, right?
  • 4:03 - 4:05
    So, that's the geometry.
  • 4:05 - 4:06
    To make equations and numbers,
  • 4:06 - 4:09
    we again introduce a coordinate system,
  • 4:09 - 4:10
    and if we know the coordinates of A and B,
  • 4:10 - 4:12
    we can easily compute the coordinates of M
  • 4:12 - 4:14
    just by averaging.
  • 4:14 - 4:16
    You now know enough to work at Pixar.
  • 4:16 - 4:18
    Let me show you.
  • 4:18 - 4:20
    So, I'm going to do something slightly terrifying
  • 4:20 - 4:22
    and move to a live demo here.
  • 4:22 - 4:26
    So, what I have is a four-point polygon here,
  • 4:26 - 4:27
    and it's going to be my job
  • 4:27 - 4:29
    to make a smooth curve out of this thing.
  • 4:29 - 4:32
    And I'm going to do it just using the idea of midpoints.
  • 4:32 - 4:33
    So, the first thing I'm going to do
  • 4:33 - 4:35
    is an operation I'll call split,
  • 4:35 - 4:37
    which adds midpoints to all those edges.
  • 4:37 - 4:39
    So, I went from four points to eight points,
  • 4:39 - 4:41
    but it's no smoother.
  • 4:41 - 4:42
    I'm going to make it a little bit smoother
  • 4:42 - 4:45
    by moving all of these points from where they are now
  • 4:45 - 4:48
    to the midpoint of their clockwise neighbor.
  • 4:48 - 4:49
    So, let me animate that for you.
  • 4:49 - 4:51
    I'm going to call that the averaging step.
  • 4:51 - 4:53
    So, now I've got eight points,
  • 4:53 - 4:54
    they're a little bit smoother,
  • 4:54 - 4:55
    my job is to make a smooth curve,
  • 4:55 - 4:57
    so what do I do?
  • 4:57 - 4:59
    Do it again. Split and average.
  • 4:59 - 5:01
    So, now I've got sixteen points.
  • 5:01 - 5:03
    I'm going to put those two steps,
  • 5:03 - 5:04
    split and average, together into something
  • 5:04 - 5:06
    I'll call subdivide,
  • 5:06 - 5:07
    which just means split and then average.
  • 5:07 - 5:09
    So, now I've got 32 points.
  • 5:09 - 5:11
    If that's not smooth enough, I'll do more.
  • 5:11 - 5:12
    I'll get 64 points.
  • 5:12 - 5:14
    Do you see a smooth curve appearing here from
  • 5:14 - 5:16
    those original points?
  • 5:16 - 5:17
    And that's how we create the shapes
  • 5:17 - 5:19
    of our charcters.
  • 5:19 - 5:21
    But remember, I said a moment ago
  • 5:21 - 5:23
    it's not enough just to know the static shape,
  • 5:23 - 5:24
    the fixed shape.
  • 5:24 - 5:26
    We need to animate it.
  • 5:26 - 5:27
    And to animate these curves,
  • 5:27 - 5:29
    the cool thing about subdivision.
  • 5:29 - 5:32
    Did you see the aliens in Toy Story?
  • 5:32 - 5:33
    You know that sound they make,
  • 5:33 - 5:35
    "Ooh"? Ready?
  • 5:35 - 5:37
    So, the way we animate these curves
  • 5:37 - 5:41
    is simply by animating the original four points.
  • 5:41 - 5:44
    "Ooh."
  • 5:44 - 5:47
    Alright, I think that's pretty cool,
  • 5:47 - 5:49
    and if you don't, the door is there,
  • 5:49 - 5:53
    it doesn't get any better than that, so.
  • 5:53 - 5:55
    This idea of splitting and averaging
  • 5:55 - 5:57
    also holds for surfaces.
  • 5:57 - 6:00
    So, I'll split, and I'll average.
  • 6:00 - 6:02
    I'll split, and I'll average.
  • 6:02 - 6:04
    Put those together into subdivide,
  • 6:04 - 6:06
    and this how we actually create the shapes
  • 6:06 - 6:09
    of all of our surface characters in three dimensions.
  • 6:09 - 6:11
    So, this idea of subdivision
  • 6:11 - 6:13
    was first used in a short film in 1997
  • 6:13 - 6:15
    called Geri's Game.
  • 6:15 - 6:17
    And Geri actually made a cameo apperance
  • 6:17 - 6:19
    in Toy Story 2 as the toy cleaner.
  • 6:19 - 6:20
    Each of his hands
  • 6:20 - 6:23
    was the first time we ever used subdivision.
  • 6:23 - 6:25
    So, each hand was a subdivision surface,
  • 6:25 - 6:27
    his face was a subdivision surface,
  • 6:27 - 6:28
    so was his jacket.
  • 6:28 - 6:30
    Here's Geri's hand before subdivision,
  • 6:30 - 6:33
    and here's Geri's hand after subdivision,
  • 6:33 - 6:35
    so subdivision just goes in and smooths out
  • 6:35 - 6:36
    all those facets,
  • 6:36 - 6:38
    and creates the beautiful surfaces
  • 6:38 - 6:40
    that you see on the screen and in the theaters.
  • 6:40 - 6:43
    Since that time, we've built all of our characters this way.
  • 6:43 - 6:47
    So, here's Merida, the lead character from Brave.
  • 6:47 - 6:48
    Her dress was a subdivision surface,
  • 6:48 - 6:49
    her hands, her face.
  • 6:49 - 6:51
    The faces and hands of all the clansman
  • 6:51 - 6:53
    were subdivision surfaces.
  • 6:53 - 6:55
    Today we've seen how addition, multiplication,
  • 6:55 - 6:59
    trigonometry and geometry play a roll in our films.
  • 6:59 - 7:00
    Given a little more time,
  • 7:00 - 7:02
    I could show you how linear algebra,
  • 7:02 - 7:05
    differential calculus, integral calculus
  • 7:05 - 7:06
    also play a roll.
  • 7:06 - 7:09
    The main thing I want you to go away with today is
  • 7:09 - 7:12
    to just remember that all the math that you're learning
  • 7:12 - 7:15
    in high school and actually up through sophomore college
  • 7:15 - 7:20
    we use all the time, everyday, at Pixar. Thanks.
Title:
Pixar: The math behind the movies - Tony DeRose
Description:

View full lesson: http://ed.ted.com/lessons/pixar-the-math-behind-the-movies-tony-derose

The folks at Pixar are widely known as some of the world's best storytellers and animators. They are perhaps less recognized as some of the most innovative math whizzes around. Pixar Research Lead Tony DeRose delves into the math behind the animations, explaining how arithmetic, trigonometry and geometry help bring Woody and the rest of your favorite characters to life.

Talk by Tony DeRose.

more » « less
Video Language:
English
Team:
closed TED
Project:
TED-Ed
Duration:
07:34

English subtitles

Revisions Compare revisions