What information is <animation> actually showing me?

I’m trying to read the animation information from Seymour_triangulate.dae, but I’m just not understanding what information the file is actually giving me.

<animation id="l_hip_rotateZ">
	<source id="l_hip_rotateZ_l_hip_rotateZ_ANGLE-input">
		<float_array id="l_hip_rotateZ_l_hip_rotateZ_ANGLE-input-array" count="3">0 0.416667 0.833333 </float_array>
		<technique_common>
			<accessor count="3" source="#l_hip_rotateZ_l_hip_rotateZ_ANGLE-input-array">
				<param name="TIME" type="float"/>
			</accessor>
		</technique_common>
	</source>
	<source id="l_hip_rotateZ_l_hip_rotateZ_ANGLE-output">
		<float_array id="l_hip_rotateZ_l_hip_rotateZ_ANGLE-output-array" count="3">0 43 0 </float_array>
		<technique_common>
			<accessor count="3" source="#l_hip_rotateZ_l_hip_rotateZ_ANGLE-output-array">
				<param name="ANGLE" type="float"/>
			</accessor>
		</technique_common>
	</source>
	<source id="l_hip_rotateZ_l_hip_rotateZ_ANGLE-intangents">
		<float_array id="l_hip_rotateZ_l_hip_rotateZ_ANGLE-intangents-array" count="3">43 0 -17.9167 </float_array>
		<technique_common>
			<accessor count="3" source="#l_hip_rotateZ_l_hip_rotateZ_ANGLE-intangents-array">
				<param name="ANGLE" type="float"/>
			</accessor>
		</technique_common>
	</source>
	<source id="l_hip_rotateZ_l_hip_rotateZ_ANGLE-outtangents">
		<float_array id="l_hip_rotateZ_l_hip_rotateZ_ANGLE-outtangents-array" count="3">17.9167 0 -43 </float_array>
		<technique_common>
			<accessor count="3" source="#l_hip_rotateZ_l_hip_rotateZ_ANGLE-outtangents-array">
				<param name="ANGLE" type="float"/>
			</accessor>
		</technique_common>
	</source>
	<source id="l_hip_rotateZ_l_hip_rotateZ_ANGLE-interpolations">
		<Name_array id="l_hip_rotateZ_l_hip_rotateZ_ANGLE-interpolations-array" count="3">BEZIER BEZIER BEZIER </Name_array>
		<technique_common>
			<accessor count="3" source="#l_hip_rotateZ_l_hip_rotateZ_ANGLE-interpolations-array">
				<param name="INTERPOLATION" type="Name"/>
			</accessor>
		</technique_common>
	</source>
	<sampler id="l_hip_rotateZ_l_hip_rotateZ_ANGLE-sampler">
		<input semantic="INPUT" source="#l_hip_rotateZ_l_hip_rotateZ_ANGLE-input"/>
		<input semantic="OUTPUT" source="#l_hip_rotateZ_l_hip_rotateZ_ANGLE-output"/>
		<input semantic="IN_TANGENT" source="#l_hip_rotateZ_l_hip_rotateZ_ANGLE-intangents"/>
		<input semantic="OUT_TANGENT" source="#l_hip_rotateZ_l_hip_rotateZ_ANGLE-outtangents"/>
		<input semantic="INTERPOLATION" source="#l_hip_rotateZ_l_hip_rotateZ_ANGLE-interpolations"/>
	</sampler>
	<channel source="#l_hip_rotateZ_l_hip_rotateZ_ANGLE-sampler" target="l_hip/rotateZ.ANGLE"/>
</animation>

From the interpolation I can see that they are bezier curves of some sort, but there seem to be 3 values from input, output, in_tangent and out_tangent. What does input, ouput, in_tangent and out_tangent even mean and how do they correspond to a bezier curve?

From another thread, I’m guessing that I’m getting 2 points and 2 tangents. Are the 3 values for input P1? and the 3 values for output P2? Are in_tangent and out_tangent tangent vectors, that I can use to make p3 and p4? Do these values go into a cubic bezier curve equation?

I’m assuming i get three values for this animation, but how does that relate to the angle used in the y-axis rotation for the l_hip like the channel says?

Here’s in principle how this should work:

since this is a BEZIER (cubic) interpolation, you need to find the 4 control points.
You have 3 keys, which gives you 2 segments

Regardless of the interpolation (STEP, LINEAR, BEZIER …), the first and last points for the segment i are given by:
P0(i)=(INPUT[i], OUTPUT[i])
P3(i)=(INPUT[i+1], OUTPUT[i+1])

for BEZIER you need P1 and P2, which are given by IN_TANGENT (P1) and OUT_TANGENT (P2)

Since the tangents are 1D (if they were 2D you would have 2 <param> in the <source>) the key value is not provided in the document, but are assumed to be equidistant from the first and last point.
So in theory we should have:

P1(i)=(INPUT[i] *2/3 + INPUT[i+1] * 1/3 , OUT_TANGENT[i])
P2(i)=(INPUT[i] *1/3 + INPUT[i+1] * 2/3. IN_TANGENT[i+1])

Note that IN_TANGENT[0] and OUT_TANGENT[n-1] are never used

That’s for the theory, but those values do not make a lot of sense. This is an area of the specification that we have left too open, so it seems the implementations are doing their own thing… definitely something we need to fix ASAP !

In the mean time it would be nice to know what those IN and OUT values are in that file.

I looked at my notes (from the book page 125), the values should be:

P1(i)=(INPUT[i] *2/3 + INPUT[i+1] * 1/3 , OUTPUT[i]+OUT_TANGENT[i])
P2(i)=(INPUT[i] *1/3 + INPUT[i+1] * 2/3. OUTPUT[i+1]-IN_TANGENT[i+1])

segment 0:
P0 = (0 0)
P1 = (0.139 17.917)
P2 = (0.278 43)
P3 = (0.417 43)

segment 1:
P0 = (0.417 43)
P1 = (0.555 43)
P2 = (0.694 17.917)
P3 = (0.833 0)

But like I said, we are going to get this right in the specification as an addendum of 1.4.1 very soon.

Hello, it’s me again

Just checking… isn’t it supposed to be:

P1(i)=(INPUT[i] *2/3 + INPUT[i+1] * 1/3 , OUTPUT[i]+OUT_TANGENT[i] / 3 )
P2(i)=(INPUT[i] *1/3 + INPUT[i+1] * 2/3. OUTPUT[i+1]-IN_TANGENT[i+1] / 3 )

Well, I guess it does not really matter, since as you said - it is not specifed and everyone seems to be doing something else.

Personally I would like to see the 1D tangents defined as dy/dx. Just my 2 cents.

David

You are right that it would be much better, since Hermite defines T = 3*(P1-P0) to find this 1/3 factor in the equation.

Regards

There’s so much confusion about how animation curves are supposed to work now. The description given by Remi above matches the curve style of the DCC packages (tangents have time values) but seems contrary to what’s described in the Collada book, and it doesn’t mention that time is no longer the independent parameter and you need to solve a cubic equation to find the new independent parameter value that satisfies a given t, and then evaluate the curve using that value to get the final output.

I really hope that the revised spec/schema allows for traditional piecewise cubic Bezier and Hermite curves. These types of curves are described in books like Computer Graphics: Principles and Practice, Real-Time Rendering, and Curves and Surfaces for Computer-Aided Geometric Design, and most graphics programmers will be familiar with them.

I understand the desire for the curves that match what the DCC tools are doing, so there should be several options available. The description of the DCC-style curves should fully explain that the inputs are no longer the independent parameters of the parametric curve, and the necessity to solve a cubic equation at each step in order to interpolate properly with a given input value.

Another thing that would be nice is if the Bezier curves stored four control points instead of two control points and two tangents, since it’s conventional to describe Bezier curves that way. Hermite curves should still be two points and two tangents.

A key point I’d like to make is that the animation curves that the DCC tools use, which dsrbecky and I discussed in this thread, are fundamentally different from traditional piecewise cubic Bezier/Hermite curves and need to be interpolated differently. It’s really not as simple as specifying time values for tangents and being done with it.

For the original poster, in the thread I linked to above you can find a pretty clear description of the interpolation math in the second and third posts of the thread. I believe you can use that math to get the correct results from the <animation> element you gave above.