Thread: Bézier interpolation, how it work ?

1. Bézier interpolation, how it work ?

Hello,

I work on a basic COLLADA viewer but I don't understand how compute the Bézier curve in : library type="ANIMATION"->sampler

How use the IN_TANGENT and OUT_TANGENT for compute the curve ?

Jérôme

2. Hello,

This is from a post from the private forum where I answer a similar question. I hope this help.

The input and output tangent values are a silent understanding between the DCC export plug-ins, as far as I know. I'm not sure it's documented anywhere, or if its a standard way of doing things...

They represent offsets from the current point to be used when determining the second and third bezier control point's positions. The bezier control points are determined as such:

[2D points are in time, value]
CP(0) = (input[N], output[N])
CP(1) = ((input[N] * 2 + input[N+1]) / 3, output[N] + out_tangent[N])
CP(2) = ((input[N] + input[N+1] * 2) / 3, output[N+1] - in_tangent[N])
CP(3) = (input[N+1], output[N+1])

In plain English, the first and fourth bezier control points are the current and next keys. The time values for the middle control points are the equidistant points along the time axis. The second control point's value is the current key's value + its out_tangent and the third control point's value is the next key's value - its in_tangent.
Note that if the curve is weighted, in Maya, ColladaMaya exports the IN_TANGENT_WEIGHT and OUT_TANGENT_WEIGHT sources for these and the formulaes change once more .

Sincerely,

3. Originally Posted by glaforte
Hello,

This is from a post from the private forum where I answer a similar question. I hope this help.

The input and output tangent values are a silent understanding between the DCC export plug-ins, as far as I know. I'm not sure it's documented anywhere, or if its a standard way of doing things...

They represent offsets from the current point to be used when determining the second and third bezier control point's positions. The bezier control points are determined as such:

[2D points are in time, value]
CP(0) = (input[N], output[N])
CP(1) = ((input[N] * 2 + input[N+1]) / 3, output[N] + out_tangent[N])
CP(2) = ((input[N] + input[N+1] * 2) / 3, output[N+1] - in_tangent[N])
CP(3) = (input[N+1], output[N+1])

In plain English, the first and fourth bezier control points are the current and next keys. The time values for the middle control points are the equidistant points along the time axis. The second control point's value is the current key's value + its out_tangent and the third control point's value is the next key's value - its in_tangent.
Note that if the curve is weighted, in Maya, ColladaMaya exports the IN_TANGENT_WEIGHT and OUT_TANGENT_WEIGHT sources for these and the formulaes change once more .

Sincerely,
Hello Guillaume,

Thank you for your help. I don't think your informations are good news for the COLLADA. "I'm not sure it's documented anywhere". It's strange , after one year of existence.