Kochanek–Bartels spline

From Wikipedia, the free encyclopedia
(Redirected from Kochanek-Bartels spline)
Jump to navigation Jump to search
File:Kochanek bartels spline.svg

In mathematics, a Kochanek–Bartels spline or Kochanek–Bartels curve is a cubic Hermite spline with tension, bias, and continuity parameters defined to change the behavior of the tangents. It was invented by Doris Kochanek of National Film Board of Canada and Richard Bartels of University of Waterloo in Canada to automate the process of creating the effect desired by the animator for interpolated motion between key frames in computer animation, reducing the need to input additional information. [1] [2]

Definition

[edit | edit source]

The key positions (data points) of each keyframe are 𝐩i, 𝐩i+1,, and are interpolated using a cubic Hermite spline.

File:KochanekBartelsSpline Fig6.png
Incoming and outgoing tangents of two key positions[3]

For each 𝐩i, define the incoming tangent vector 𝐃𝐒 and the outgoing tangent vector 𝐃𝐃 as follows:

𝐃𝐒i=(1t)(1+b)(1c)2(𝐩i𝐩i1)+(1t)(1b)(1+c)2(𝐩i+1𝐩i) 𝐃𝐃i=(1t)(1+b)(1+c)2(𝐩i𝐩i1)+(1t)(1b)(1c)2(𝐩i+1𝐩i)

For the interval between the start point 𝐩i and the end point 𝐩i+1, Kochanek-Bartels spline is obtained by applying the starting tangent vector 𝐦i=𝐃𝐃i and the ending tangent vector 𝐦i+1=𝐃𝐒i+1 to the definition formula of cubic Hermite spline.

Parameters and Effects

[edit | edit source]
Parameter Effect and Purpose
default (t=b=c=0)
File:KochanekBartelsSpline all0.gif
Example
The tangent vector is simply the average of the source chord 𝐩i𝐩i1 and the destination chord 𝐩i+1𝐩i, is the Catmull–Rom spline.
t Tension
File:KochanekBartelsSpline tn05 tn-05.gif
Example (red: 0.5, blue: 0.5
controls how sharply the curve bends at a key position.

Tension is implemented as a scale factor which changes the length of both the incoming and outgoing parts of the tangent vector equally at a key position. If t>0, the length of the tangent vector is reduced to zero and tightens the curve, if t<0, the length of the tangent vector is increased and produced more slack in the curve.

b Bias
File:KochanekBartelsSpline bi05 bi-05.gif
Example(red: 0.5, blue: 0.5
simulates the traditional animation effect of following through after an action by "overshooting", or exaggerating a movement by "undershooting" a key position.

Tangents are formed as an average of incoming and outgoing chords, but the bias controls the direction of the path as it passes through a key position by assigning different weights to the two chords when forming the average. If b<0, the weight of the destination chord is greater, and if b>0, the weight of the source chord is greater.

c Continuity
File:KochanekBartelsSpline tn1 cn-1.gif
Example(red: t=1, blue: c=1
reduces continuity, would produce the desired abrupt change. For example, to make the movement of a ball careening off a tree look convincing, with altering its direction of motion at the point of impact without slowing down ahead of time.

If c<0, the weight of the destination chord is greater for incoming tangent vector, and the weight of the source chord is greater for outgoing tangent vector.

In this case, the motion path looks similar to when t is increased, but the motion dynamics are different. When t is increased, the length of the tangent vector, and therefore the velocity, decreases as it approaches the key position, so there is no discontinuity. On the other hand, when c is decreased, the velocity remains constant and there is an abrupt change in direction at the key position.

Example of Implementation

[edit | edit source]

The source code of Steve Noskowicz in 1996 actually describes the impact that each of these values has on the drawn curve:[4]

Tension T = +1→ Tight T = −1→ Round
Bias B = +1→ Post Shoot B = −1→ Pre shoot
Continuity C = +1→ Inverted corners C = −1→ Box corners

The code includes matrix summary needed to generate these splines in a BASIC dialect.

References

[edit | edit source]
  1. ^ Lua error in Module:Citation/CS1/Configuration at line 2172: attempt to index field '?' (a nil value).
  2. ^ Lua error in Module:Citation/CS1/Configuration at line 2172: attempt to index field '?' (a nil value).
  3. ^ Kochanek, Bartels (1984), p.36, Figure 6
  4. ^ Lua error in Module:Citation/CS1/Configuration at line 2172: attempt to index field '?' (a nil value).
[edit | edit source]
  • Lua error in Module:Citation/CS1/Configuration at line 2172: attempt to index field '?' (a nil value).