Pixar: The math behind the movies - Tony DeRose

696,948 views ・ 2014-03-25

TED-Ed


請雙擊下方英文字幕播放視頻。

譯者: Jesse Chen 陳鉦翰 審譯者: Jheng-Han Chen
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
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
如果已得知 A 和 B 的座標
04:10
we can easily compute the coordinates of M
109
250472
1933
就可以藉由算出平均
04:12
just by averaging.
110
252405
1337
輕易得到 M 的座標
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
就只要移動原本的四個點
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
主角「傑瑞」有立體的外表
06:16
in Toy Story 2 as the toy cleaner.
172
376782
2418
他就是《玩具總動員 2》清理玩具的爺爺
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
皮克斯無時無刻都在使用
謝謝
關於本網站

本網站將向您介紹對學習英語有用的 YouTube 視頻。 您將看到來自世界各地的一流教師教授的英語課程。 雙擊每個視頻頁面上顯示的英文字幕,從那裡播放視頻。 字幕與視頻播放同步滾動。 如果您有任何意見或要求,請使用此聯繫表與我們聯繫。

https://forms.gle/WvT1wiN1qDtmnspy7