Computer Animation. Rick Parent

Similar documents
Interpolating/approximating pp gcurves

CS 475 / CS 675 Computer Graphics. Lecture 16 : Interpolation for Animation

Fundamentals of Computer Animation

Fall CSCI 420: Computer Graphics. 4.2 Splines. Hao Li.

Computer Graphics Curves and Surfaces. Matthias Teschner

3D Modeling Parametric Curves & Surfaces. Shandong University Spring 2013

Motivation. Parametric Curves (later Surfaces) Outline. Tangents, Normals, Binormals. Arclength. Advanced Computer Graphics (Fall 2010)

Splines. Parameterization of a Curve. Curve Representations. Roller coaster. What Do We Need From Curves in Computer Graphics? Modeling Complex Shapes

Parametric curves. Brian Curless CSE 457 Spring 2016

3D Modeling Parametric Curves & Surfaces

Animation. Animation

Information Coding / Computer Graphics, ISY, LiTH. Splines

Design considerations

Animation. Computer Graphics COMP 770 (236) Spring Instructor: Brandon Lloyd 4/23/07 1

08 - Designing Approximating Curves

In this course we will need a set of techniques to represent curves and surfaces in 2-d and 3-d. Some reasons for this include

Spline Notes. Marc Olano University of Maryland, Baltimore County. February 20, 2004

Know it. Control points. B Spline surfaces. Implicit surfaces

Parametric curves. Reading. Curves before computers. Mathematical curve representation. CSE 457 Winter Required:

CS130 : Computer Graphics Curves. Tamar Shinar Computer Science & Engineering UC Riverside

3.3 Interpolation of rotations represented by quaternions

Animating orientation. CS 448D: Character Animation Prof. Vladlen Koltun Stanford University

Central issues in modelling

CS130 : Computer Graphics Curves (cont.) Tamar Shinar Computer Science & Engineering UC Riverside

Interactive Graphics. Lecture 9: Introduction to Spline Curves. Interactive Graphics Lecture 9: Slide 1

Sung-Eui Yoon ( 윤성의 )

COMPUTER AIDED ENGINEERING DESIGN (BFF2612)

Objects 2: Curves & Splines Christian Miller CS Fall 2011

Computer Animation Fundamentals. Animation Methods Keyframing Interpolation Kinematics Inverse Kinematics

Parametric Curves. University of Texas at Austin CS384G - Computer Graphics Fall 2010 Don Fussell

The goal is the definition of points with numbers and primitives with equations or functions. The definition of points with numbers requires a

Visualizing Quaternions

Computer Animation. Algorithms and Techniques. z< MORGAN KAUFMANN PUBLISHERS. Rick Parent Ohio State University AN IMPRINT OF ELSEVIER SCIENCE

Curves and Surfaces for Computer-Aided Geometric Design

Parametric Curves. University of Texas at Austin CS384G - Computer Graphics

Curve Representation ME761A Instructor in Charge Prof. J. Ramkumar Department of Mechanical Engineering, IIT Kanpur

Computer Graphics Splines and Curves

Computer Animation 4-Motion Control SS 13

CGT 581 G Geometric Modeling Curves

Visualizing Quaternions

Bezier Curves, B-Splines, NURBS

Interpolation and Basis Fns

Splines. Connecting the Dots

Animation Curves and Splines 2

Curves. Computer Graphics CSE 167 Lecture 11

2D Spline Curves. CS 4620 Lecture 18

Intro to Curves Week 1, Lecture 2

Curves D.A. Forsyth, with slides from John Hart

Freeform Curves on Spheres of Arbitrary Dimension

Curve and Surface Basics

Introduction p. 1 What Is Geometric Modeling? p. 1 Computer-aided geometric design Solid modeling Algebraic geometry Computational geometry

CS 536 Computer Graphics Intro to Curves Week 1, Lecture 2

Curves and Surfaces. CS475 / 675, Fall Siddhartha Chaudhuri

Quaternions and Rotations

Introduction to Computer Graphics

Representing Curves Part II. Foley & Van Dam, Chapter 11

A Curve Tutorial for Introductory Computer Graphics

Animation. Keyframe animation. CS4620/5620: Lecture 30. Rigid motion: the simplest deformation. Controlling shape for animation

Fathi El-Yafi Project and Software Development Manager Engineering Simulation

Mathematical Tools in Computer Graphics with C# Implementations Table of Contents

Animation. CS 4620 Lecture 33. Cornell CS4620 Fall Kavita Bala

For each question, indicate whether the statement is true or false by circling T or F, respectively.

Animation. CS 4620 Lecture 32. Cornell CS4620 Fall Kavita Bala

Construction and smoothing of triangular Coons patches with geodesic boundary curves

2D Spline Curves. CS 4620 Lecture 13

CSE 167: Introduction to Computer Graphics Lecture #11: Bezier Curves. Jürgen P. Schulze, Ph.D. University of California, San Diego Fall Quarter 2016

Geometric Modeling of Curves

Lecture IV Bézier Curves

CS 445 / 645 Introduction to Computer Graphics. Lecture 21 Representing Rotations

GL9: Engineering Communications. GL9: CAD techniques. Curves Surfaces Solids Techniques

Intro to Curves Week 4, Lecture 7

CHAPTER 6 Parametric Spline Curves

Spline Curves. Spline Curves. Prof. Dr. Hans Hagen Algorithmic Geometry WS 2013/2014 1

Keyword: Quadratic Bézier Curve, Bisection Algorithm, Biarc, Biarc Method, Hausdorff Distances, Tolerance Band.

Trajectory Planning for Automatic Machines and Robots

COMPUTER AIDED GEOMETRIC DESIGN. Thomas W. Sederberg

CSE 167: Introduction to Computer Graphics Lecture #13: Curves. Jürgen P. Schulze, Ph.D. University of California, San Diego Fall Quarter 2017

Orientation & Quaternions

Simple Keyframe Animation

Part II: OUTLINE. Visualizing Quaternions. Part II: Visualizing Quaternion Geometry. The Spherical Projection Trick: Visualizing unit vectors.

Computer Graphics I Lecture 11

3D Transformations World Window to Viewport Transformation Week 2, Lecture 4

Reading. Parametric surfaces. Surfaces of revolution. Mathematical surface representations. Required:

Applications of Dual Quaternions in Three Dimensional Transformation and Interpolation

Jorg s Graphics Lecture Notes Coordinate Spaces 1

3. The three points (2, 4, 1), (1, 2, 2) and (5, 2, 2) determine a plane. Which of the following points is in that plane?

Transformations Week 9, Lecture 18

An introduction to interpolation and splines

Flank Millable Surface Design with Conical and Barrel Tools

Computergrafik. Matthias Zwicker. Herbst 2010

Interpolation and Basis Fns

Channels & Keyframes. CSE169: Computer Animation Instructor: Steve Rotenberg UCSD, Winter 2017

Arc-Length Parameterized Spline Curves for Real-Time Simulation

Ch. 6: Trajectory Generation

Natural Numbers and Integers. Big Ideas in Numerical Methods. Overflow. Real Numbers 29/07/2011. Taking some ideas from NM course a little further

Temporal Face Normal Interpolation

Physically-Based Modeling and Animation. University of Missouri at Columbia

Curves and Surfaces Computer Graphics I Lecture 9

CSE 167: Introduction to Computer Graphics Lecture 12: Bézier Curves. Jürgen P. Schulze, Ph.D. University of California, San Diego Fall Quarter 2013

Curves and Surface I. Angel Ch.10

Transcription:

Algorithms and Techniques Interpolating Values

Animation Animator specified interpolation key frame Algorithmically controlled Physics-based Behavioral Data-driven motion capture

Motivation Common problem: given a set of points Smoothly (in time and space) move an object through the set of points Example additional temporal constraints: t From zero velocity at first point, smoothly accelerate until time t1, hold a constant velocity until time t2, then smoothly decelerate to a stop at the last point at time t3

Motivation solution steps 1C 1. Construct ta space curve tht that interpolates the given points with piecewise first order continuity p=p(u) 2. Construct an arc-length-parametric- value function for the curve 3. Construct time-arc-length function according to given constraints u=u(s) s=s(t) p=p(u(s(t)))

Interpolating function Interpolation v. approximation Complexity: cubic Continuity: first degree (tangential) Local v. global control: local Information requirements: tangents needed?

Interpolation v. Approximation

Complexity Low complexity reduced computational cost Point of Inflection Can match arbitrary tangents at end points CUBIC polynomial

Continuity

Local v. Global l Control

Information requirements just the points tangents interior control points just beginning and ending tangents

Curve Formulations Lagrange Polynomial Piecewise cubic polynomials Hermite Catmull-Rom Blended Parabolas Bezier B-spline Tension-Continuity-Bias 4-Point Form

Lagrange Polynomial P j ( x) = y x x j k = 1 x j k j x x k k

Lagrange Polynomial P j ( x) = y x x j k = 1 x j k j x x k k

Polynomial Curve Formulations Need to match real-world data v. design from scratch Information requirements: just points? tangents? Qualities of final curve? Intuitive enough? Blending Other shape controls? Functions T P = U MB = FB = U T A [ 1] 3 2 u u u Coefficient matrix Geometric information Algebraic coefficient matrix

Hermite 2.0 3.0 3.0 2.0 1.0 p 3 2 i+ 1 P = [ u u u 1] 0.0 2.0 0.0 1.0 1.0 1.0 0.0 p p p i i 1.0 0.0 0.0 0.0 ' +11 i '

Cubic Bezier 1.0 3.0 3.0 1.0 3 2 3.0 6.0 3.0 0. 0 pi+1 P = [ u u u 1] 3.0 1.0 Interior control points play the same role as the tangents of the Hermite formulation 3.0 0.0 0.0 p 0.0 p i+ 2 0.0 0.0 p i +33 p i

Blended Parabolas/Catmull-Rom* 0.5 1.5 1.5 0.5 p 3 2 1 2.5 2 0. 5 pi P = [ u u u 1] 0.5 0 0 0.5 p p i 1 i+ 1 1 0 0 p i +22 0 * End conditions are handled differently

Controlling Motion along p=p(u) Step 2. Reparameterization by arc length u = U(s) where s is distance along the curve Step 3. Speed control for example, ease-in / ease-out s = ease(t) where t is time

Reparameterizing by Arc Length Analytic Forward differencing Supersampling Adaptive approach Numerically Adaptive Gaussian

Reparameterizing by Arc Length - analytic 3 2 P ( u) = au + bu + cu + d dp s u = 2 u 1 dp / du du / du = ( dx ( u ) / du dy ( u ) / du dz ( u ) / du ) ( dx ( u ) / du ) 2 + ( dy ( u ) / du ) 2 ( dx ( u ) / ) 2 dp / du = + du Can t always be solved analytically yfor our curves

Reparameterizing i by Arc Length - supersample 1.Calculate a bunch of points at small increments in u 2.Compute summed linear distances as approximation to arc length 3.Build table of (parametric value, arc length) pairs Notes 1.Often useful to normalize total distance to 1.0 2.Often useful to normalize parametric value for multi-segment curve to 1.0

index u Arc Length Build table of 0 000 0.00 0.000000 approx. lengths 1 0.05 0.080 2 0.10 0.150 3 0.15 0.230......... 20 100 1.00 1.000

Adaptive Approach How fine to sample? Compare successive approximations and see if they agree within some tolerance Test can fail subdivide to predefined level, then start testing

Reparameterizing by Arc Length - quadrature + 1 ( u) du = 1 f w f ( ) i i u i 3 2 P ( u) = au + bu + cu + d 1 + 1 Au 4 + Bu 3 + Cu 2 + Du + E Lookup tables of weights and parametric values Can also take adaptive approach here

Reparameterizing by Arc Length Analytic Forward differencing Supersampling Adaptive approach Numerically Adaptive Gaussian Sufficient for many problems

Speed Control distance Time-distance function Ease-in Cubic polynomial Sinusoidal segment Segmented sinusoidal Constant acceleration General distance-time functions time

Time Distance Function s S s = S(t) t

Ease-in/Ease-out Function s 1.0 S s = S(t) 0.0 0.0 10 1.0 t Normalize distance and time to 1.0 to facilitate reuse

Ease-in: Sinusoidalid s ( sin( tπ / 2) 1) / 2 = ease( t) = π +

Ease-in: Piecewise cws Sinusoidal Snuso

Ease-in: Piecewise cws Sinusoidal Snuso 2 tπ π ( k (sin( )) 2k 2 / 1 π 1 f t <= k 1 ease(t) = k ( 1 + t k 1) / π / 2 f k < t <= 1 k 2 k ( π / 2 2 π ( t k ) k 2 k 1 + (1 k 2 ) sin( )) / π 2(1 k ) 2 ( 1 + 2 f k < t 2 where f = 2 k1 + k2 k1 + (1 k π ( 2 2 ) π Provides linear (constant t velocity) middle segment

Ease-in: Single Cubic s = ease( t) = 2t + 3t 3 2

Ease-in: Constant t Acceleration

Ease-in: Constant t Acceleration

Ease-in: Constant t Acceleration

Ease-in: Constant t Acceleration

Constant Acceleration 2 t d = v 0 2t 1 0.0 < t t 1 d t1 = v0 + v0( t t1) t1 < t t2 2 d t1 ( t t2 ) = v0 + v0( t2 t1) + v0(1 )( t t2) t2 < t 1. 0 2 2(1 t ) 2

Motivation solution steps 1C 1. Construct ta space curve tht that interpolates the given points with piecewise first order continuity p=p(u) 2. Construct an arc-length-parametric- value function for the curve 3. Construct time-arc-length function according to given constraints u=u(s) s=s(t) p=p(u(s(t)))

Arbitrary Speed Control Animators can work in: Distance-time space curves Velocity-time space curves Acceleration-time space curves Set time-distance t constraints t etc.

Curve fitting to distance-time pairs

Working with time-distance curves

Interpolating distance-time time pairs

Frenet Frame control orientation

Frenet Frame tangent & curvature vector

Frenet Frame tangent & curvature vector P( u) = UMB P '( u ) = P''( u) = [ 1] 3 2 U = u u u

Frenet Frame tangent & curvature vector P( u) = UMB P '( u ) = U ' MB P''( u) = U '' MB [ ] 3 2 U = u u u 1 [ 2 U ' = 3u 2u 1 0 ] U '' = [ 6u 2 0 0]

Frenet Frame local coordinate system Directly control orientation of object/camera Use for direction and bank into turn, especially for ground-planar curves (e.g. roads) v is perpendicular to w if curve is parameterized by arclength; otherwise probably not perpendicular For general curve must v = wxu

Frenet Frame - undefined

Frenet Frame - discontinuity

Other ways to control orientation Use auxiliary curve to define direction or up vector Use point P(s+ds) for direction

Direction & Up vector v = u x w To keep head up, use y-axis to compute over and up vectors perpendicular to direction vector u=w x y-axis w Direction vector If up vector supplied, use that instead of y-axis

Orientation interpolation Preliminary note: 1. Remember that Rotq ( v) Rotkq( v) 2. Affects of scale are divided out by the inverse appearing in quaternion rotation 3.When interpolating quaternions, use UNIT quaternions otherwise magnitudes can interfere with spacing of results of interpolation

Orientation interpolation Quaternions can be interpolated to produce in-between orientations: ti q = ( 1 k) q + kq 2 problems analogous to issues when interpolating positions: 1. How to take equi-distant steps along orientation path? 2. How to pass through orientations smoothly (1 st order continuous) 1 3. And another particular to quaternions: with dual unit quaternion representations, which h to use? 2

Dual representation Rot ( v) Rot ( v) q = kq Dual unit quaternion representations For Interpolation between q1 and q2, compute cosine between q1 and q2 and between q1 and q2; choose smallest angle

Interpolating quaternions Unit quaternions form set of points on 4D sphere Linearly interpolating unit quaternions: not equally spaced

Interpolating quaternions in great arc => equal spacing

Interpolating quaternions with equal spacing slerp( q 1, q 2, u) = sin(1 u) θ q sinθ 1 + sin uθ q sinθ 2 where q 1 q2 = cosθ slerp, sphereical linear interpolation is a function of the beginning quaternion orientation, q1 the ending quaternion orientation, q2 the interpolant, u

Smooth Orientation interpolation Use quaternions Interpolate along great arc (in 4-space) using cubic Bezier on sphere 1S 1. Select representation to use from duals 2. Construct interior control points for cubic Bezier 3. use DeCastelajue construction of cubic Bezier

Smooth quaternion interpolation ti Similar to first order continuity desires with positional interpolation How to smoothly interpolate through orientations q 1, q 2, q 3, q n Bezier interpolation geometric construction

Bezier interpolation ti

Bezier interpolation ti Construct interior control points t n b n p n p n-1 a n p n p p n 1 n+2 p n-1 p n a a n p n+2 p n+1 p n+1 p n-1 p n p a n p n+2 a pn+1 0 b n+1 a n+1 t n+1 p 0 p 1 p2

Quaternion operators q 2 bisect(q 1, q 2 ) q b Similar to forming a vector between 2 points, form the rotation between 2 orientations q b q 1 double(q 1, q 2 ) Given 2 orientations, form result of applying rotation ti between the two to 2 nd orientation q 2 q d q 1

Quaternion operators: double ( p, q) = r Double where q is the midorientation between p and the yetto-be-determined r If p and q are unit quaternions, Then q = cos(θ)q and cos(θ)= q ' = cos( θ ) q = ( p q)q p q Given p and q, form r p q q θ θ θ r double( p, q) bisect( p, r) = q Bisect 2 orientations: if p and r are unit length = r = q' + ( q' p) = 2( p q) q p p + r bisect( p, r ) = = p + r Given p and r, form q q

Bezier interpolation ti Need quaternion-friendly operators to form interior control points

Bezier interpolation ti Construct interior control points t n p n p n-1 a n p n+2 a n = n bisect(double( pn 1, pn), p + 1) b n b = double( a, q n p n+1 p n-1 ( n n ) p n a n p n+2 p n+1 p 1 p n a p n-1 a n pn+1 b n+1 p n+2 a n+1 Bezier segment: q n, a n, b n+1, q n+1 t n+1

Bezier construction using quaternion operators Need quaternion-friendly operations to interpolate cubic Bezier curve using quaternion points de Casteljau geometric construction algorithm

Bezier construction using quaternion operators For p(1/3) t 1 =slerp(q n, a n,1/3) t 2 =slerp(a n, b n+1,1/3) t 3 =slerp(b n+1, q n+1,1/3) t 12 =slerp(t 1, t 2,1/3) t 23 =slerp(t 12, t 23,1/3) q=slerp(t 12, t 23,1/3)

Working with paths Smoothing a path Determining a path along a surface Finding downhill direction

Smoothing data

Smoothing data

Smoothing data

Smoothing data

Smoothing data

Smoothing data

Smoothing data

Smoothing data

Smoothing data

Smoothing data

Smoothing data

Smoothing data

Path finding

Path finding -downhill hll