Pixar: The math behind the movies - Tony DeRose

695,529 views ・ 2014-03-25

TED-Ed


请双击下面的英文字幕来播放视频。

翻译人员: Fen Guan 校对人员: Peipei Xiang
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
起始位置大了 4 个单位。
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
这样,我从四个点得到八个点,
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
这样,我得到了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
三维人物外形的方法。
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
我们在皮克斯一直在用,每天都在用。谢谢
关于本网站

这个网站将向你介绍对学习英语有用的YouTube视频。你将看到来自世界各地的一流教师教授的英语课程。双击每个视频页面上显示的英文字幕,即可从那里播放视频。字幕会随着视频的播放而同步滚动。如果你有任何意见或要求,请使用此联系表与我们联系。

https://forms.gle/WvT1wiN1qDtmnspy7