CSCE 441 Computer Graphics: Keyframe Animation/Smooth Curves Jinxiang Chai
Outline Keyframe interpolation Curve representation and interpolation - natural cubic curves - Hermite curves - Bezier curves Required readings: HB 8-8,8-9, 8-10
Computer Animation Animation - making objects moving Compute animation - the production of consecutive images, which, when displayed, convey a feeling of motion.
Animation Topics Rigid body simulation - bouncing ball - millions of chairs falling down
Animation Topics Rigid body simulation - bouncing ball - millions of chairs falling down Natural phenomenon - water, fire, smoke, mud, etc.
Animation Topics Rigid body simulation - bouncing ball - millions of chairs falling down Natural phenomenon - water, fire, smoke, mud, etc. Character animation - articulated motion, e.g. full-body animation - deformation, e.g. face
Animation Topics Rigid body simulation - bouncing ball - millions of chairs falling down Natural phenomenon - water, fire, smoke, mud, etc. Character animation - articulated motion, e.g. full-body animation - deformation, e.g. face Cartoon animation
Animation Criterion Physically correct - rigid body-simulation - natural phenomenon Natural - character animation Expressive - cartoon animation
Keyframe Animation
Keyframe Interpolation What’s the inbetween motion? t=0 t=50ms
Outline Process of keyframing Key frame interpolation Hermite and bezier curve Splines Speed control
2D Animation Highly skilled animators draw the key frames Less skilled (lower paid) animators draw the in- between frames Time consuming process Difficult to create physically realistic animation
3D Animation Animators specify important key frames 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
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
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 What are the parameters? –position and orientation –body deformation –facial features –hair and clothing –lights and cameras
Outline Process of keyframing Key frame interpolation Hermite and bezier curve Splines Speed control
Inbetween Frames Linear interpolation Cubic curve interpolation
Keyframe Interpolation t=0 t=50ms
Linear Interpolation Linearly interpolate the parameters between keyframes
Cubic Curve Interpolation We can use three cubic functions to represent a 3D curve Each function is defined with the range 0 <= t <=1
Compact Representation
Smooth Curves Controlling the shape of the curve
Smooth Curves Controlling the shape of the curve
Smooth Curves Controlling the shape of the curve
Smooth Curves Controlling the shape of the curve
Smooth Curves Controlling the shape of the curve
Smooth Curves Controlling the shape of the curve
Constraints on the cubics How many constraints do we need to determine a cubic curve?
Constraints on the Cubic Functions How many constraints do we need to determine a cubic curve?
Constraints on the Cubic Functions How many constraints do we need to determine a cubic curve?
Constraints on the Cubic Functions How many constraints do we need to determine a cubic curve?
Constraints on the Cubic Functions How many constraints do we need to determine a cubic curve? 4
Natural Cubic Curves Q(t 1 )Q(t 2 )Q(t 3 ) Q(t 4 )
Interpolation Find a polynomial that passes through specified values
Interpolation Find a polynomial that passes through specified values
Interpolation Find a polynomial that passes through specified values
Interpolation Find a polynomial that passes through specified values
Interpolation Find a polynomial that passes through specified values
2D Trajectory Interpolation Perform interpolation for each component separately Combine result to obtain parametric curve
2D Trajectory Interpolation Perform interpolation for each component separately Combine result to obtain parametric curve
2D Trajectory Interpolation Perform interpolation for each component separately Combine result to obtain parametric curve
Constraints on the Cubic Curves How many constraints do we need to determine a cubic curve? 4 - does not provide local control of the curve
Constraints on the Cubic Curves How many constraints do we need to determine a cubic curve? 4 - does not provide local control of the curve Redefine C as a product of the basis matrix M and the control vector G: C= MG
Constraints on the cubic curves How many constraints do we need to determine a cubic curve? 4 - does not provide local control of the curve Redefine C as a product of the basis matrix M and the control vector G: C= MG MG
Constraints on the Cubic Curves How many constraints do we need to determine a cubic curve? 4 - does not provide local control of the curve Redefine C as a product of the basis matrix M and the control vector G: C= MG M G
Constraints on the Cubic Curves How many constraints do we need to determine a cubic curve? 4 - does not provide local control of the curve Redefine C as a product of the basis matrix M and the control vector G: C= MG M? G?
Outline Process of keyframing Key frame interpolation Hermite and bezier curve Splines Speed control
Hermite Curve A Hermite curve is determined by - endpoints P 1 and P 4 - tangent vectors R 1 and R 4 at the endpoints P1P1 R1R1 P4P4 R4R4
Hermite Curve A Hermite curve is determined by - endpoints P 1 and P 4 - tangent vectors R 1 and R 4 at the endpoints Use these elements to control the curve, i.e. construct control vector P1P1 R1R1 P4P4 R4R4 MhMh GhGh
Hermite Basis Matrix Given desired constraints: - endpoints meet P 1 and P 4 Q(0) = [ ] · M h · G h = P 1 Q(1) = [ ] · M h · G h = P 4 - tangent vectors meet R 1 and R 4
Tangent Vectors
Hermite Basis Matrix Given desired constraints: - endpoints meet P 1 and P 4 Q(0) = [ ] · M h · G h = P 1 Q(1) = [ ] · M h · G h = P 4 - tangent vectors meet R 1 and R 4 Q’(0) =[ ] · M h · G h =R 1 Q’(1) =[ ] · M h · G h =R 4
Hermite Basis Matrix Given desired constraints: - endpoints meet P 1 and P 4 Q(0) = [ ] · M h · G h = P 1 Q(1) = [ ] · M h · G h = P 4 - tangent vectors meet R 1 and R 4 Q’(0) =[ ] · M h · G h =R 1 Q’(1) =[ ] · M h · G h =R 4 So how to compute the basis matrix M h ?
Hermite Basis Matrix We can solve for basis matrix M h MhMh
Hermite Basis Matrix We can solve for basis matrix M h MhMh
Hermite Basis Matrix P1P1 R1R1 P4P4 R4R4
Hermite Basis Function Let’s define B as a product of T and M B h (t) indicates the weight of each element in G h
Bezier Curve Indirectly specify tangent vectors by specifying two intermediate points P1P1 R1R1 P3P3 R2R2 P2P2 P4P4
Bezier Curve Indirectly specify tangent vectors by specifying two intermediate points P1P1 R1R1 P3P3 R4R4 P2P2 P4P4
Bezier Curve Indirectly specify tangent vectors by specifying two intermediate points P1P1 R1R1 P3P3 R4R4 P2P2 P4P4 How to compute the basis matrix M b ?
Bezier Basis Matrix Establish the relation between Hermite and Bezier control vectors
Bezier Basis Matrix Establish the relation between Hermite and Bezier control vectors
Bezier Basis Matrix Establish the relation between Hermite and Bezier control vectors M hb GbGb
Bezier Basis Matrix For Hermite curves, we have For Bezier curves, we have
Bezier Basis Matrix For Hermite curves, we have For Bezier curves, we have
Bezier Basis Matrix P1P1 P3P3 P2P2 P4P4
Hermite basis function Let’s define B as a product of T and M B h (t) indicates the weight of each element in G h
Hermite basis function Let’s define B as a product of T and M B h (t) indicates the weight of each element in G h What’s function of this red curve?
Hermite basis function Let’s define B as a product of T and M B h (t) indicates the weight of each element in G h What’s function of this red curve? 2t 3 -3t 2 +1
Bezier basis functions Bezier blending functions are also called Bernstein polynomials
Bezier basis functions Bezier blending functions are also called Bernstein polynomials What’s function of this red curve?
Bezier basis functions Bezier blending functions are also called Bernstein polynomials What’s function of this red curve? -t 3 +3t 2 -3t+1
Bezier basis functions Bezier blending functions are also called Bernstein polynomials What’s function of this red curve? -t 3 +3t 2 -3t+1
How to interpolate a 3D curve x y z o
x y z o Bezier curve
Try this online at - Move the interpolation point, see how the others (and the point on curve) move - Control points (can even make loops) Bezier java applet
Cubic curves: Hermite curves: Bezier curves: Different basis functions
Complex curves Suppose we want to draw a more complex curve
Complex curves Suppose we want to draw a more complex curve How can we represent this curve?
Complex curves Suppose we want to draw a more complex curve Why not use a high-order Bézier? - Wiggly curves - No local control
Complex curves Suppose we want to draw a more complex curve Why not use a high-order Bézier? - Wiggly curves - No local control Instead, we’ll splice together a curve from individual segments that are cubic Béziers
Complex curves Suppose we want to draw a more complex curve Why not use a high-order Bézier? - Wiggly curves - No local control Instead, we’ll splice together a curve from individual segments that are cubic Béziers
Complex curves Suppose we want to draw a more complex curve Why not use a high-order Bézier? - Wiggly curves - No local control Instead, we’ll splice together a curve from individual segments that are cubic Béziers
Complex curves Suppose we want to draw a more complex curve Why not use a high-order Bézier? - Wiggly curves - No local control Instead, we’ll splice together a curve from individual segments that are cubic Béziers Why cubic? - Lowest dimension with control for the second derivative - Lowest dimension for non-planar polynomial curves
Next lecture Spline curve and more key frame interpolation