Kochanek-Bartels Cubic Splines (TCB Splines)

Similar documents
Important Properties of B-spline Basis Functions

Extraction of Level Sets from 2D Images

Least-Squares Fitting of Data with B-Spline Curves

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

Distance Between Point and Triangle in 3D

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

Objects 2: Curves & Splines Christian Miller CS Fall 2011

2D Spline Curves. CS 4620 Lecture 13

Appendices - Parametric Keyframe Interpolation Incorporating Kinetic Adjustment and Phrasing Control

Interpolation and Basis Fns

Computer Graphics Lecture 5

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

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

Interpolation and Basis Fns

Parametric curves. Brian Curless CSE 457 Spring 2016

2D Spline Curves. CS 4620 Lecture 18

Curves and Surfaces 1

This handout will discuss three kinds of asymptotes: vertical, horizontal, and slant.

Connected Minimal Acceleration Trigonometric Curves

1 Introduction 2. 2 A Simple Algorithm 2. 3 A Fast Algorithm 2

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

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

Shape modeling Modeling technique Shape representation! 3D Graphics Modeling Techniques

Polynomials tend to oscillate (wiggle) a lot, even when our true function does not.

February 23 Math 2335 sec 51 Spring 2016

Slope of the Tangent Line. Estimating with a Secant Line

2.4. Rates of Change and Tangent Lines. Copyright 2007 Pearson Education, Inc. Publishing as Pearson Prentice Hall

Computer Graphics I. Midterm Examination. October 23, This is a closed-book exam; only one double-sided sheet of notes is permitted.

Critical and Inflection Points

Information Coding / Computer Graphics, ISY, LiTH. Splines

08 - Designing Approximating Curves

AP Calculus AB Unit 2 Assessment

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

Splines. Connecting the Dots

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

Rational Bezier Curves

Graphing Functions. 0, < x < 0 1, 0 x < is defined everywhere on R but has a jump discontinuity at x = 0. h(x) =

Knot Insertion and Reparametrization of Interval B-spline Curves

AH Properties of Functions.notebook April 19, 2018

Let be a function. We say, is a plane curve given by the. Let a curve be given by function where is differentiable with continuous.

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

3D Modeling Parametric Curves & Surfaces

Level Set Extraction from Gridded 2D and 3D Data

Until now we have worked with flat entities such as lines and flat polygons. Fit well with graphics hardware Mathematically simple

MCS 118 Quiz 1. Fall (5pts) Solve the following equations for x. 7x 2 = 4x x 2 5x = 2

LECTURE 18 - OPTIMIZATION

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

Finite Element Analysis Prof. Dr. B. N. Rao Department of Civil Engineering Indian Institute of Technology, Madras. Lecture - 24

CHAPTER 6 Parametric Spline Curves

CGT 581 G Geometric Modeling Curves

THS Step By Step Calculus Chapter 3

Differentiation. The Derivative and the Tangent Line Problem 10/9/2014. Copyright Cengage Learning. All rights reserved.

3D Modeling techniques

COMP3421. Global Lighting Part 2: Radiosity

Intersection of a Triangle and a Cone

Bezier Curves, B-Splines, NURBS

Computer Graphics Curves and Surfaces. Matthias Teschner

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

a) y = x 3 + 3x 2 2 b) = UNIT 4 CURVE SKETCHING 4.1 INCREASING AND DECREASING FUNCTIONS

Figure 5.1: Spline and ducks.

Parameterization of triangular meshes

Interpolation - 2D mapping Tutorial 1: triangulation

Subdivision Surfaces

Unit 1: Sections Skill Set

PS Geometric Modeling Homework Assignment Sheet I (Due 20-Oct-2017)

CS-184: Computer Graphics. Today

MA 323 Geometric Modelling Course Notes: Day 14 Properties of Bezier Curves

Derivatives and Graphs of Functions

Rational Bezier Surface

lim x c x 2 x +2. Suppose that, instead of calculating all the values in the above tables, you simply . What do you find? x +2

Tessellation of a Unit Sphere Starting with an Inscribed Convex Triangular Mesh

A Curve Tutorial for Introductory Computer Graphics

CS 559 Computer Graphics Midterm Exam March 22, :30-3:45 pm

Exam 1 Review. MATH Intuitive Calculus Fall Name:. Show your reasoning. Use standard notation correctly.

The following information is for reviewing the material since Exam 3:

Minimum-Volume Box Containing a Set of Points

BS-Patch: Constrained Bezier Parametric Patch

EECS 487, Fall 2005 Exam 2

Subdivision curves and surfaces. Brian Curless CSE 557 Fall 2015

Curves and Surfaces. CS475 / 675, Fall Siddhartha Chaudhuri

Sung-Eui Yoon ( 윤성의 )

The Free-form Surface Modelling System

Numerical Methods in Physics Lecture 2 Interpolation

Alvy Ray Smith Computer Graphics Project Lucasfilm Ltd. Technical Memo No May 1983

An Introduction to B-Spline Curves

Inverse and Implicit functions

To find the intervals on which a given polynomial function is increasing/decreasing using GGB:

(Spline, Bezier, B-Spline)

Computer Animation. Rick Parent

AP Calculus. Slide 1 / 213 Slide 2 / 213. Slide 3 / 213. Slide 4 / 213. Slide 4 (Answer) / 213 Slide 5 / 213. Derivatives. Derivatives Exploration

Splines, or: Connecting the Dots. Jens Ogniewski Information Coding Group

CIS 665 GPU Programming and Architecture

Section 1: Limits and Continuity

Perspective Mappings. Contents

Increasing/Decreasing Behavior

Objectives. Materials

B-Spline Polynomials. B-Spline Polynomials. Uniform Cubic B-Spline Curves CS 460. Computer Graphics

Geometric Modeling of Curves

On the Parameterization of Catmull-Rom Curves. Cem Yuksel Scott Schaefer John Keyser Texas A&M University

Geometric modeling 1

Transcription:

Kochanek-Bartels Cubic Splines (TCB Splines) David Eberly, Geometric Tools, Redmond WA 9805 https://www.geometrictools.com/ This work is licensed under the Creative Commons Attribution 4.0 International License. To view a copy of this license, visit http://creativecommons.org/licenses/by/4.0/ or send a letter to Creative Commons, PO Box 1866, Mountain View, CA 9404, USA. Created: July 16, 1999 Last Modified: February 14, 008 Contents 1 Introduction Cubic Polynomial Curves 3 Choosing Tangent Vectors (t i = i) 3 3.1 Tension................................................ 4 3. Continuity............................................... 5 3.3 Bias.................................................. 6 4 Adjustments for Nonuniform Sample Times 6 1

1 Introduction A sequence of positional key frames is {(t i, P i, T I i, T O i )} n 1 i=0 where t i is the sample time, P i is the sample position, T I i is the incoming tangent vector, and T O i is the outgoing tangent vector. The Kochanek-Bartels spline [1] specifies a cubic polynomial interpolation between each pair of key frames by choosing the incoming and outgoing tangents in a special way. The incoming and outgoing tangent vectors at P i need not be the same vector, in which case the spline has a derivative discontinuity at that position. The tangents at P i are chosen based on neighboring positions and on three parameters that have some visual appeal. The parameters are tension τ i which controls how sharply the curve bends at a control point, continuity γ i which controls the continuity (or discontinuity) at a position, and bias β i which controls the direction of the path at P i by taking weighted combination of one-sided derivatives at that position. Figure 1 shows a typical position, tangent vectors, and the curve segments passing through the position. Figure 1. A cubic spline curve passing through point P with incoming tangent T I and outgoing tangent T O. The Kochanek-Bartels splines are sometimes called TCB splines, the acronoym referring to tension, continuity, and bias. Cubic Polynomial Curves In general, a cubic polynomial curve can be constructed to represent the curve connecting a pair of key frames (t i, P i, T I i, T O i ) and (t i+1, P i+1, T I i+1, T O i+1). Such a curve is of the form ( ) ( ) ( ) 3 t ti t ti t ti X i (t) = A i + B i + C i + D i where = t i+1 t i and where t [t i, t i+1 ]. The vector-valued coefficients of the polynomial are determined by requiring X i (t i ) = P i, X i (t i+1 ) = P i+1, X i(t i ) = T O i, X i(t i+1 ) = T I i+1 That is, the curve must pass through the end points and the curve derivatives at the end points must match the specified tangent vectors. The four linear equations implied by these conditions are A i = P i A i + B i + C i + D i = P i+1 B i = T O i B i + C i + 3D i = T I i+1

The solution is A i = P i B i = T O i C i = 3(P i+1 P i ) (T O i + T I i+1) D i = (P i+1 P i ) + (T O i + T I i+1) The curve may be rewritten to use a Hermite interpolation basis H 0 (s) = s 3 3s + 1, H 1 (s) = s 3 + 3s, H (s) = s 3 s + s, and H 3 (s) = s 3 s, namely ( ) ( ) ( ) ( ) t ti t ti t ti t X i (t) = H 0 P i + H 1 P i+1 + H T O ti i + H 3 T I i+1 (1) A spline is formed by the sequence of curves X i (t), 0 i n. Each segment is continuous and differentiable. The spline is continuous over all segments since it passes through all the sample positions. Whether or not the spline is differentiable at the sample positions depends on the choice of incoming and outgoing tangent vectors. The spline is said to have G 1 continuity at position P i if the incoming and outgoing tangents T I i and T O i are in the same direction (not necessarily of equal lengths). The spline is said to have C 1 continuity at the sample position if the incoming and outgoing tangents are equal (in the same direction and of equal length). 3 Choosing Tangent Vectors (t i = i) We now look at the choices for tangent vectors based on the tension, continuity, and bias parameters. You will notice that the section heading mentions that the sample times are t i = i. The formulation in [1] implicitly assumes this, but mention is made later about adjustments to the tangents when nonuniform sample times are used in order to obtain continuity of speed, that is, continuity of the length of the tangent vectors to the curve. This issue needs closer attention than what is provided in [1]; I will do so in the next section. The default values for tension τ i, continuity γ i, and bias β i are all zero. outgoing tangent vectors are chosen to be the same vector, In this case the incoming and T I i = T O i = 1 ((P i+1 P i ) + (P i P i 1 )) = P i+1 P i 1 It is important to notice that the units of the tangent vectors are position divided by time. The right-hand side of equation () appears to have units of position. To make the left-hand sides and the right-hand side are commensurate, you must think of the denominator of the right-hand side as units of time, thus making the units match. This choice of tangents leads to the Catmull-Rom spline. The tangent vector at P i is chosen to be parallel to the secant vector from P i 1 to P i+1 as shown in Figure. () 3

Figure. The Catmull-Rom spline. The tangent vector at P i is chosen to be parallel to the secant vector connecting the neighboring positions. The tangent is also viewed as the average change in position between the sample position and its neighboring sample positions. Figure 3 shows a Catmull-Rom spline for six sample positions. The spline has C 1 continuity everywhere. Figure 3. The Catmull-Rom spline for six sample positions with uniform sampling in time ( t i is constant). We are going to modify each of the tension, continuity, and bias parameters at the sample position shown in red to see how the shape of the curve varies at that point. 3.1 Tension Tension τ i [ 1, 1] is introduced as a parameter in the equations () as shown below, T I i = T O i = (1 τ i) ((P i+1 P i ) + (P i P i 1 )). (3) As noted earlier, the units must match between the left-hand and right-hand sides. The tension is dimensionless, so the in the denominator must be thought of as having units of time. If τ i = 0, then we have the Catmull-Rom spline. For τ i near 1 the curve is tightened at the control point while τ i near 1 produces slack at the control point. Varying τ i changes the length of the tangent at the control point, a smaller tangent leading to a tightening and a larger tangent leading to a slackening. Figure 4 shows nonzero tension values applied to the red sample position of Figure 3. 4

Figure 4. Left: Tension τ i = 1 at the sample position. Right: Tension τ i = 1 at the sample position. 3. Continuity Continuity γ i [ 1, 1] is introduced as a parameter in the equations () as shown below. Notice that the incoming and outgoing tangents are generally different. T I i = 1 + γ i (P i+1 P i ) + 1 γ i (P i P i 1 ), T O i = 1 γ i (P i+1 P i ) + 1 + γ i (P i P i 1 ) (4) Once again the in the denominator must be viewed as having units of time so that the units match between the left-hand and right-hand sides. When γ i = 0, the curve has a continuous tangent vector at the control point. As γ i increases, the resulting curve has a corner at the control point, the direction of the corner depending on the sign of γ i. Figure 5 shows nonzero continuity values applied to the red sample position of Figure 3. Figure 5. Left: Continuity γ i = 1 at the sample position. Right: Continuity γ i = 1 at the sample position. In both images of the figure it is apparent that the curve has neither C 1 nor G 1 continuity at the red sample position. 5

3.3 Bias Bias β i [ 1, 1] is introduced as a parameter in the equations () as shown below. As with tension, the incoming and outgoing tangents are chosen to be equal. T I i = T O i = 1 β i (P i+1 P i ) + 1 + β i (P i P i 1 ) (5) As in the other cases, the in the denominator has units of time in order that the units of the left-hand and right-hand sides match. When β i = 0 the left and right one-sided tangents are equally weighted, producing the Catmull-Rom spline. For β i near 1, the outgoing tangent dominates the direction of the path of the curve through the control point (undershooting). For β i near 1, the incoming tangent dominates (overshooting). Figure 6 shows nonzero continuity values applied to the red sample position of Figure 3. Figure 6. Left: Bias β i = 1 at the sample position. Right: Bias β i = 1 at the sample position. The three effects may be combined into a single set of equations and T I i = (1 τ i)(1 + γ i )(1 β i ) T O i = (1 τ i)(1 γ i )(1 β i ) (P i+1 P i ) + (1 τ i)(1 γ i )(1 + β i ) (P i P i 1 ) (6) (P i+1 P i ) + (1 τ i)(1 + γ i )(1 + β i ) (P i P i 1 ) (7) 4 Adjustments for Nonuniform Sample Times The discussion in [1] includes mention of adjustments of the tangent vectors in equations (6) and (7) in order to account for nonuniform sample times. In particular, the authors assume default continuity, γ i = 0, the implication being that T I i = T O i in equations (6) and (7). Although the incoming and outgoing tangents are the same (implying G 1 continuity), the authors mention that the speeds of the two segments meeting at P i may be different due to nonuniform sample times. The proposed solution is to adjust the lengths of the tangent vectors to force the speed at P i to be continuous (implying C 1 continuity). The adjustments are stated as ( T I N i (1 τi )(1 + γ i )(1 β i ) i = (P i+1 P i ) + (1 τ ) i)(1 γ i )(1 + β i ) (P i P i 1 ) (8) N i 1 + N i 6

and T O i = N ( i 1 (1 τi )(1 γ i )(1 β i ) (P i+1 P i ) + (1 τ ) i)(1 + γ i )(1 + β i ) (P i P i 1 ) N i 1 + N i (9) where N i 1 is the number of inbetweens that will be used for the time interval [t i 1, t i ] and N i is the number of inbetweens that will be used for the time interval [t i, t i+1 ]. Although this approach has some intuitive appeal, it is not the correct way to deal with continuity of speed at P i. Continuity at a single point is not related to the quantity and selection of a discrete set of inbetweens. Continuity of speed is a calculus concept that requires the one-sided limits of the speed function σ(t) at t i to be finite and equal. That is lim t t i σ(t) = lim t t + i σ(t) = σ(t i ). In our current setting, this is just a statement that the lengths of the incoming and outgoing tangents at P i must be the same. Clearly the incoming and outgoing tangents defined by equations (8) and (9) do not have the same length when N i N i 1. So the question remains: How do we include the nonuniform sample times in the incoming and outgoing tangent formulas to force continuity of speed at t i? My opinion is that if you choose to introduce tension, continuity, and bias differently for each of P i+1 P i and P i P i 1, then the inclusion of the time differences should be those relevant to the positional differences. The incoming and outgoing tangents should be T I i = (1 τ i)(1 + γ i )(1 β i ) P i+1 P i + (1 τ i)(1 γ i )(1 + β i ) P i P i 1 1 (10) and T O i = (1 τ i)(1 γ i )(1 β i ) P i+1 P i + (1 τ i)(1 + γ i )(1 + β i ) P i P i 1 1 (11) When γ i = 0 the incoming and outgoing tangents are equal, so the curve has C 1 continuity at P i regardless of the choice of tension and bias. When γ i 0, if you decide you want continuity of speed even though you do not have continuity of direction, an adjustment is made to obtain incoming and outgoing tangents that do have the same length. One such choice is and V I i = V O i = T O i T I i + T O i TI i (1) T I i T I i + T O i TO i (13) where T I i and T O i are defined by equations (10) and (11). It is simple to verify that V I i = V O i, so continuity in speed occurs at P i. Observe that both adjustment coefficients are 1 in the case of γ i = 0. References [1] Doris H. U. Kochanek and Richard H. Bartels, Interpolating splines with local tension, continuity, and bias control, ACM SIGGRAPH 1984, vol. 18, no. 3, pp. 33-41. 7