Animated Models - z_up_axis to y_up_axis
I'm having a heck of a time trying to convert my z_up_axis collada file to a y_up_axis collada file.
For static geometry I can just do for each vertex:
y = z
z = -y
(essentially a -90 degree rotation along the x axis)
But for animated models this doesnt work as there is extra data that will be in the wrong coordinate system.
My skinning equation is:
vertex * bindShapeMatrix * InverseBindMatrix * Joint
The biggest confusion is not really knowing which data is in it's own space and thus "immune" to z_up_axis or y_up_axis differences.
Does anyone know which data (And how) should be changed in order to convert a z_up_axis model to a y_up_axis model?
Thank you very much!
Re: Animated Models - z_up_axis to y_up_axis
COLLADA (almost) always defines things in local coordinate systems. It would be better not to bake the axis rotation into the vertices, since different users (i.e. node elements) of the mesh might specifiy a differet up-axis.
If you don't bake the up-axis into the geometry then the bind shape is unchanged. The asset's up-axis can (should) be applied at the point of instantiation (i.e. to the destination object-space). This is coveraged by the object-space skinning definition as described on pdf page 37 of the COLLADA 1.5 specification.