Creating a Collada file using 4x4 rotation matrices

I am trying to create a program to generate a collada file from a camera rotation.

I have managed to create this collada file that is imported perfectly by Maya but not by Blender or Cinema4D. This code is the camera rotating in x, then in z, then in y. For this example, Y is up.

I have achieved this by guessing out of thin air and trial and error.

As far as I guessed, this part

    <float_array id="camera1-Matrix-animation-input-array" count="2">
      0.009988 10.017378 

represents the times where the keyframes happen. The times are calculated by dividing the keyframe number per the fps.

The second part

<float_array id="camera1-Matrix-animation-output-transform-array" count="32">
0.999528 0.026086 0.016230 0.000000 -0.016529 0.011292 0.999800 0.000000 -0.025897 0.999596 -0.011718 0.000000 0.000000 0.000000 0.000000 1.000000 0.997373 0.039929 -0.060431 0.000000 -0.036339 0.997573 0.059389 0.000000 -0.062656 0.057037 -0.996404 0.000000 0.000000 0.000000 0.000000 1.000000

is basically two 4x4 transformation arrays.

Without taking my file as correct, can someone point out the write format I should use to create a collada file (may be Collada 1.4.1) that contains the camera animation as transformation matrices?

What I need is this, a very simple example of the collada file that represents a simple rotation of the camera with just two keyframes, represented as transform/rotation matrices.


Blender’s facilities are a poor effort. I think Maya uses OpenCOLLADA, but I do not know, if that’s its default implementation of COLLADA or not.

The easiest way to make an example for this is to use Maya to setup the animation, and export the scene/session to COLLADA’s DAE format. Open the DAE file, and take a peek. I am not versed in all of the animation options available to COLLADA, so I cannot offer more help at this time. Using 4x4 matrices is standard for animating character models, although quaternions may be used instead. (COLLADA also probably facilitates animations based on constructing curves from 3-D points.)