Pixar: The math behind the movies - Tony DeRose

695,529 views ・ 2014-03-25

TED-Ed


Please double-click on the English subtitles below to play the video.

00:06
At Pixar, we're all about telling stories,
0
6663
2377
00:09
but one story that hasn't been told very much
1
9040
2293
00:11
is the huge degree to which math is used
2
11333
2669
00:14
in the production of our films.
3
14002
1416
00:15
The math that you're learning in
4
15418
1421
00:16
middle school and high school
5
16839
1548
00:18
is used all the time at Pixar.
6
18387
2121
00:20
So, let's start with a very simple example.
7
20508
2587
00:23
Anybody recognize this guy? (Cheers)
8
23095
3632
00:26
Yeah, so this is Woody from Toy Story,
9
26727
2578
00:29
and let's ask Woody to, say, walk across the stage
10
29305
2666
00:31
from, say, left to right, just like that.
11
31971
2550
00:34
So, believe it or not, you just saw a ton of mathematics.
12
34521
4367
00:38
Where is it?
13
38888
1167
00:40
Well, to explain that,
14
40055
2059
00:42
it's important to understand
15
42114
1208
00:43
that artists and designers think in terms of
16
43322
1754
00:45
shape and images
17
45076
1753
00:46
but computers think in terms of numbers and equations.
18
46829
2810
00:49
So, to bridge those two worlds
19
49639
1583
00:51
we use a mathematical concept called
20
51222
1666
00:52
coordinate geometry, right?
21
52888
1864
00:54
That is, we lay down a coordinate system
22
54752
2002
00:56
with x describing how far something is to the right
23
56754
3417
01:00
and y describing how high something is.
24
60171
2774
01:02
So, with these coordinates we can describe
25
62945
2274
01:05
where Woody is at any instant in time.
26
65219
2335
01:07
For instance, if we know the coordinates of
27
67554
2167
01:09
the lower left corner of that image,
28
69721
2082
01:11
then we know where the rest of the image is.
29
71803
1969
01:13
And in that little sliding animation we saw a second ago,
30
73772
2699
01:16
that motion we call translation,
31
76471
2000
01:18
the x coordinate started with a value of one,
32
78471
3002
01:21
and it ended with a value of about five.
33
81473
2833
01:24
So, if we want to write that in mathematics,
34
84306
2394
01:26
we see that the x at the end is four bigger
35
86700
3438
01:30
than x at the start.
36
90138
1915
01:32
So, in other words, the mathematics of translation
37
92053
3029
01:35
is addition.
38
95082
1418
01:36
Alright?
39
96500
1335
01:37
How about scaling?
40
97835
1137
01:38
That is making something bigger or smaller.
41
98972
2331
01:41
Any guesses as to what the mathematics of scaling might be?
42
101303
2835
01:44
Dilation, multiplication, exactly.
43
104138
4084
01:48
If you're going to make something twice as big,
44
108222
1667
01:49
you need to mulitply the x and the y coordinates
45
109889
2416
01:52
all by two.
46
112305
1639
01:53
So, this shows us that the mathematics of scaling
47
113944
2248
01:56
is mulitiplication.
48
116192
1329
01:57
Okay?
49
117521
1033
01:58
How about this one?
50
118554
918
01:59
How about rotation? Alright, spinning around.
51
119472
3250
02:02
The mathematics of rotation is trigonometry.
52
122722
3349
02:06
So, here's an equation that expresses that.
53
126071
2068
02:08
It looks a little scary at first.
54
128139
1855
02:09
You'll probably get this in eighth or ninth grade.
55
129994
3001
02:12
If you find yourselves sitting in trigonometry class
56
132995
3005
02:16
wondering when you're ever going to need this stuff,
57
136000
2759
02:18
just remember that any time you see anything rotate
58
138759
2411
02:21
in one of our films,
59
141170
1384
02:22
there's trigonometry at work underneath.
60
142554
2252
02:24
I first fell in love with mathematics in seventh grade.
61
144806
2370
02:27
Any seventh graders? A few of you? Yeah.
62
147176
2546
02:29
My seventh grade science teacher showed me
63
149722
2333
02:32
how to use trigonometry to compute
64
152055
1665
02:33
how high the rockets that I was building was going.
65
153720
2920
02:36
I just thought that was amazing,
66
156640
1415
02:38
and I've been enamored with math ever since.
67
158055
3085
02:41
So, this is kind of old mathematics.
68
161140
1719
02:42
Mathematics that's been known and, you know,
69
162859
1446
02:44
developed by the old dead Greek guys.
70
164305
2835
02:47
And there's a myth out there that all the interesting
71
167140
2081
02:49
mathematics has already been figured out,
72
169221
2272
02:51
in fact all of mathematics has been figured out.
73
171493
2836
02:54
But the real story is that new mathematics
74
174329
1975
02:56
is being created all the time.
75
176304
1820
02:58
And some of it is being created at Pixar.
76
178124
2210
03:00
So, I'd like to give you an example of that.
77
180334
2221
03:02
So, here are some characters
78
182555
1617
03:04
from some of our early films:
79
184172
1716
03:05
Finding Nemo, Monsters Inc. and Toy Story 2.
80
185888
4546
03:10
Anybody know who the blue character in the upper left is?
81
190434
3248
03:13
It's Dory. Okay, that was easy.
82
193682
1957
03:15
Here's a little harder one.
83
195639
963
03:16
Anybody know who's the character in the lower right?
84
196602
3251
03:19
Al McWhiggin from Al's Toy Barn, exactly.
85
199853
2592
03:22
The thing to notice about these characters
86
202445
1859
03:24
is they're really complicated.
87
204304
1472
03:25
Those shapes are really complicated.
88
205776
2002
03:27
In fact, the toy cleaner, I have an example,
89
207778
4027
03:31
the toy cleaner there in the middle,
90
211805
2272
03:34
here's his hand.
91
214077
1669
03:35
You can imagine how fun it was to bring this
92
215746
2003
03:37
through airport security.
93
217749
3168
03:40
His hand is a really complicated shape.
94
220917
1920
03:42
It's not just a bunch of spheres and cylinders stuck together, right?
95
222837
2875
03:45
And not only is it complicated,
96
225712
1879
03:47
but it has to move in complicated ways.
97
227591
2136
03:49
So, I'd like to tell you how we do that,
98
229727
1782
03:51
and to do that I need to tell you about midpoints.
99
231509
2262
03:53
So, here's a couple of points, A and B,
100
233771
1950
03:55
and the line segment between them.
101
235721
1378
03:57
We're going to start out first in two dimensions.
102
237099
2205
03:59
The midpoint, M, is the point
103
239304
1718
04:01
that splits that line segment in the middle, right?
104
241022
2367
04:03
So, that's the geometry.
105
243389
1719
04:05
To make equations and numbers,
106
245108
1363
04:06
we again introduce a coordinate system,
107
246471
2058
04:08
and if we know the coordinates of A and B,
108
248529
1943
04:10
we can easily compute the coordinates of M
109
250472
1933
04:12
just by averaging.
110
252405
1337
04:13
You now know enough to work at Pixar.
111
253742
2503
04:16
Let me show you.
112
256245
1333
04:17
So, I'm going to do something slightly terrifying
113
257578
1963
04:19
and move to a live demo here.
114
259541
2514
04:22
So, what I have is a four-point polygon here,
115
262055
3917
04:25
and it's going to be my job
116
265972
1116
04:27
to make a smooth curve out of this thing.
117
267088
2044
04:29
And I'm going to do it just using the idea of midpoints.
118
269132
2629
04:31
So, the first thing I'm going to do
119
271761
1168
04:32
is an operation I'll call split,
120
272929
1960
04:34
which adds midpoints to all those edges.
121
274889
2208
04:37
So, I went from four points to eight points,
122
277097
2124
04:39
but it's no smoother.
123
279221
1297
04:40
I'm going to make it a little bit smoother
124
280518
1204
04:41
by moving all of these points from where they are now
125
281722
2969
04:44
to the midpoint of their clockwise neighbor.
126
284691
3114
04:47
So, let me animate that for you.
127
287805
1417
04:49
I'm going to call that the averaging step.
128
289222
1917
04:51
So, now I've got eight points,
129
291139
1417
04:52
they're a little bit smoother,
130
292556
1083
04:53
my job is to make a smooth curve,
131
293639
1686
04:55
so what do I do?
132
295325
1565
04:56
Do it again. Split and average.
133
296890
2187
04:59
So, now I've got sixteen points.
134
299077
1920
05:00
I'm going to put those two steps,
135
300997
1557
05:02
split and average, together into something
136
302554
1615
05:04
I'll call subdivide,
137
304169
1447
05:05
which just means split and then average.
138
305616
1833
05:07
So, now I've got 32 points.
139
307449
1813
05:09
If that's not smooth enough, I'll do more.
140
309262
1438
05:10
I'll get 64 points.
141
310700
1417
05:12
Do you see a smooth curve appearing here from
142
312117
1854
05:13
those original points?
143
313971
1667
05:15
And that's how we create the shapes
144
315638
1479
05:17
of our charcters.
145
317117
2105
05:19
But remember, I said a moment ago
146
319222
1336
05:20
it's not enough just to know the static shape,
147
320558
2587
05:23
the fixed shape.
148
323145
1001
05:24
We need to animate it.
149
324146
1387
05:25
And to animate these curves,
150
325533
1744
05:27
the cool thing about subdivision.
151
327277
1623
05:28
Did you see the aliens in Toy Story?
152
328900
2753
05:31
You know that sound they make,
153
331653
881
05:32
"Ooh"? Ready?
154
332534
2167
05:34
So, the way we animate these curves
155
334701
2249
05:36
is simply by animating the original four points.
156
336950
4129
05:41
"Ooh."
157
341079
2587
05:43
Alright, I think that's pretty cool,
158
343666
3117
05:46
and if you don't, the door is there,
159
346783
2303
05:49
it doesn't get any better than that, so.
160
349086
3697
05:52
This idea of splitting and averaging
161
352783
1834
05:54
also holds for surfaces.
162
354617
2186
05:56
So, I'll split, and I'll average.
163
356803
3419
06:00
I'll split, and I'll average.
164
360222
2041
06:02
Put those together into subdivide,
165
362263
1604
06:03
and this how we actually create the shapes
166
363867
1749
06:05
of all of our surface characters in three dimensions.
167
365616
3490
06:09
So, this idea of subdivision
168
369106
1428
06:10
was first used in a short film in 1997
169
370534
2700
06:13
called Geri's Game.
170
373234
1587
06:14
And Geri actually made a cameo apperance
171
374821
1961
06:16
in Toy Story 2 as the toy cleaner.
172
376782
2418
06:19
Each of his hands
173
379200
1127
06:20
was the first time we ever used subdivision.
174
380327
2541
06:22
So, each hand was a subdivision surface,
175
382868
1799
06:24
his face was a subdivision surface,
176
384667
1839
06:26
so was his jacket.
177
386506
1329
06:27
Here's Geri's hand before subdivision,
178
387835
1948
06:29
and here's Geri's hand after subdivision,
179
389783
2803
06:32
so subdivision just goes in and smooths out
180
392586
2004
06:34
all those facets,
181
394590
1252
06:35
and creates the beautiful surfaces
182
395842
1834
06:37
that you see on the screen and in the theaters.
183
397676
2440
06:40
Since that time, we've built all of our characters this way.
184
400116
3066
06:43
So, here's Merida, the lead character from Brave.
185
403182
3378
06:46
Her dress was a subdivision surface,
186
406560
1753
06:48
her hands, her face.
187
408313
1169
06:49
The faces and hands of all the clansman
188
409482
1718
06:51
were subdivision surfaces.
189
411200
1621
06:52
Today we've seen how addition, multiplication,
190
412821
2245
06:55
trigonometry and geometry play a roll in our films.
191
415066
3772
06:58
Given a little more time,
192
418838
1237
07:00
I could show you how linear algebra,
193
420075
1792
07:01
differential calculus, integral calculus
194
421867
2795
07:04
also play a roll.
195
424662
1371
07:06
The main thing I want you to go away with today is
196
426033
3167
07:09
to just remember that all the math that you're learning
197
429200
2917
07:12
in high school and actually up through sophomore college
198
432117
2973
07:15
we use all the time, everyday, at Pixar. Thanks.
199
435090
4835
About this website

This site will introduce you to YouTube videos that are useful for learning English. You will see English lessons taught by top-notch teachers from around the world. Double-click on the English subtitles displayed on each video page to play the video from there. The subtitles scroll in sync with the video playback. If you have any comments or requests, please contact us using this contact form.

https://forms.gle/WvT1wiN1qDtmnspy7