Pixar: The math behind the movies - Tony DeRose

684,503 views ・ 2014-03-25

TED-Ed


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

Translator: H_L Au Reviewer: 潘 可儿
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
用 x 表示要向右行幾多
01:00
and y describing how high something is.
24
60171
2774
用 y 表示要去幾高
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
x 座標值會由 1 開始
01:21
and it ended with a value of about five.
33
81473
2833
去到大約 5 就停
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
最尾個 x
01:30
than x at the start.
36
90138
1915
就大個開頭個 x
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
你要將 x 同 y 嘅坐標
01:52
all by two.
46
112305
1639
全部乘 2
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
《海底奇兵》、 《怪獸公司》、《反斗奇兵 2》
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
呢到有兩點,A 同 B
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
中點 M 喺呢度
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
如果我哋知 AB 嘅座標
04:10
we can easily compute the coordinates of M
109
250472
1933
我哋就計到 M 嘅座標
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
4 個中點就變到 8 個點
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
咁宜家我有 8 點
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
咁宜家我就有 16 點
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
宜家我有 32 點
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
就會有 64 點
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
好簡單咁郁原本嗰 4 點
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
所有嘅人物嘅3D 外型
06:09
So, this idea of subdivision
168
369106
1428
細分呢個概念
06:10
was first used in a short film in 1997
169
370534
2700
喺 1997 年一套叫《棋局》嘅
06:13
called Geri's Game.
170
373234
1587
短動畫度首次採用
06:14
And Geri actually made a cameo apperance
171
374821
1961
主角基里後尾有喺 《反斗奇兵2》度客串
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