02-Keyframe Animation
合集下载
相关主题
- 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
- 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
- 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。
Mb = Mh Mhb
−1 3 = −3 1
3 −3 −6 3 3 0 0 0
1 0 0 0
http://www.cs.unc.edu/~mantler/research/bezier/index.html
Bézier blending functions
Bezier blending functions are also called Bernstein polynomials
0 1 0 2
0 1 1 1
1 1 0 0
−1
2 −3 = 0 1
−2 3 0 0
1 1 −2 −1 1 0 0 0
Hermite Blending functions
Let’s define B as a product of T and M
Bh (t) = t3 t2 t 1 2 −2 1 1 −3 3 −2 −1 0 0 1 0 1 0 0 0
3D animation
• Animators specify important keyframes in 3D • Computers generates the in-between frames • Some dynamic motion can be done by computers (hair, clothes, etc) • Still time consuming; Pixar spent four years to produce Toy Story
Keyframe animation
• Process of keyframing • Keyframe interpolation • Hermite and Bezier curves • Splines • Speed control
Oldest keyframe animation
• Two conditions to make moving images in 19th century • at least 10 frames per second • a period of blackness between images
• What are the parameters? • position and orientation • body deformation • facial features • hair and clothing • lights and cameras
• Process of keyframing • Keyframe interpolation • Hermite and Bezier curves • Splines • Speed control
or
Qx (t) = ax t + bx t + cx t + dx
Qy (t) = ay t3 + by t2 + cy t + dy
3 2
Qz (t) = az t + bz t + cz t + dz
3
2
Compact representation
Q(t) = [Qx (t) Qy (t) Qz (t)]
P1 R1 P4 R4
• Use these elements to construct geometry matrix P1x P1y P1z
P4x Gh = R1x R4x P4y R1y R4y P4z R1z R4z
Hermite basis matrix
Given desired constraints: 1. endpoints meet P1 and P4
Bb (t) = t3 t2 t 1 −1 3 −3 3 −6 3 −3 3 0 1 0 0
Bb (t)
1 0 0 0
P1 P2 Q(t) = Bb (t) · P3 P4
P1 P2 P3
P4
t
Complex curves
What if we want to model a curve that passes through these points?
In-between frames
• Linear interpolation • Cubic curve interpolation
Linear interpolation
Linearly interpolate the parameters between keyframes
t=5 t=0
t = 10 t = 15
Qx (t) = ax t3 + bx t2 + cx t + dx
Qy (t) = ay t3 + by t2 + cy t + dy
Qz (t) = az t3 + bz t2 + cz t + dz
ax bx C= cx dx ay by cy dy az bz cz dz
Q(t) = [x(t) y (t) z (t)]
bold: a vector or a matrix italic: a scalar vectors a · b : inner product a × b : cross product ab : multiplication matrices A · B : multiplication AB : multiplication
Q(0) = Q(1) = 0 1 0 1 0 1 1 1 · Mh · Gh = P1 · Mh · Gh = P4
2. tangent vectors meet R1 and R4
˙ (0) = Q ˙ (1) = Q 0 0 3 2 1 1 0 0 · Mh · Gh = R1 · Mh · Gh = R4
2D animation
• Highly skilled animators draw the keyframes • Less skilled (lower paid) animators draw the in-between frames • Time consuming process • Difficult to create physically realistic animation
P1 1 P4 0 = Gh = R1 −3 R4 0
0 0 0 0 3 0 0 −3
0 P1 1 P2 = Mhb · Gb 0 P3 3 P4
Bézier basis matrix
Q(t) = T · Mh · Gh = T · Mh · (Mhb · Gb ) = T · (Mh · Mhb ) · Gb = T · Mb · Gb
=T·M·G
• Process of keyframing • Keyframe interpolation • Hermite and Bezier curves • Splines • Speed control
Hermite curves
• A Hermite curve is determined by • endpoints P1 and P4 • tangent vectors R1 and R4 at the endpoints
A keyframe
• In 2D animation, a keyframe is usually a single image • In 3D animation, each keyframe is defined by a set of parameters
Keyframe parameters
Problem with higher order polynomials: Wiggly curves No local control
Bh(t) indicates the weight of each element in Gh
Bh (t)
P1 P4 Q(t) = Bh (t) · R1 R4
P1
P4
R1
t
R4
Bézier curves
Indirectly specify tangent vectors by specifying two intermediate points
T=
t3
t2
t 1
Compact representation
Q(t) = t3 t2 t 1 ax bx cx dx ay by cy dy az bz = TC cz dz
d ˙ Q = Q(t) = dt
3t2
2t 1
0
C
Constraints on the cubics
Hermite basis matrix
We can solve for basis matrix Mh
P1 0 P4 = Gh = 1 R1 0 R4 3 0 1 0 2 0 1 1 1 1 1 · Mh · Gh 0 0
0 1 Mh = 0 3
“A bug’s life”
http://www.pixar.com/featurefilms/abl/behind_pop4.html
The process of keyframing
• Specify the keyframes • Specify the type of interpolation • linear, cubic, parametric curves • Specify the speed profile of the interpolation • constant velocity, ease-in-ease-out, etc • Computer generates the in-between frames
How many constraints do we need to determine a cubic curve? 4 Redefine C as a product of the basis matrix M and the geometry matrix G
C=M·G
Q(t) = t3 t2 t 1 m11 m21 m31 m41 m12 m22 m32 m42 m13 m23 m33 m43 G1x m14 m24 G2x m34 G3x G4x m44 G1y G2y G3y G4y G1z G2z G3z G4z
General pipeline
• Story board • Keyframes • Inbetweens • Painting
Storyboards
• The film in outline form • specify the key scenes • specify the camera moves and edits • specify character gross motion • Typically paper and pencil sketches on individual sheets taped on a wall
end key start key
x = x0 +
t − t0 (x1 − x0 ) t1 − t0
start time
end time
Cubic curve interpolation
We can use three cubic functions to represent a 3D curve Each function is defined with the range 0 ≤ t ≤ 1
R1
R1 = 3(P2 − P1 ) R4 = 3(P4 − P3 )
P3 P4
P1
P2 R4
P1 P2 Gb = P3 P4
Fra Baidu bibliotek
Bézier basis matrix
Establish the relation between Hermite and Bezier geometry vectors