As per FBX documentation, rotation animations can be specified with different Euler formats (axes order). This is currently not parsed from the loader resulting in wrong animations.
/ping @looeee
I'll look into it over the next couple of days.
@ignazioa if you could share some model (preferably very simple ones) with different rotation order that I can use for testing that would speed things up.
@looeee Don't have a simple one but the following has RotationOrder property defined in several nodes:
test_rotation_order.zip
Thank you, I'll find some time to look into this over the next couple of days.
Here are some test files in case anybody else comes across this
@looeee Any idea on what to do with RotationOrder = eSPHERIC_XYZ = 6 ?
Yes - show a warning saying that it's not supported 馃槈
@looeee FYI, after some tests I had to move 'PreRotation' order parsing to where reference to the model was available (and its RotationOrder). See below, hope it helps
`
var orderEnum = ['XYZ', 'XZY', 'YZX', 'YXZ', 'ZXY', 'ZYX', 'XYZ'];
for ( var containerIndicesIndex = containerIndices.length - 1; containerIndicesIndex >= 0; -- containerIndicesIndex ) {
var boneID = findIndex( sceneGraph.skeleton.bones, function ( bone ) {
return bone.FBX_ID === containerIndices[ containerIndicesIndex ].ID;
} );
if ( boneID > - 1 ) {
returnObject.containerBoneID = boneID;
returnObject.containerID = containerIndices[ containerIndicesIndex ].ID;
var model = rawModels[ returnObject.containerID.toString() ];
if ( 'PreRotation' in model.properties ) {
order = 'XYZ';
if('RotationOrder' in model.properties)
{
order = orderEnum[model.properties.RotationOrder.value];
}
order = reverse(order);
var preRotations = parseVector3( model.properties.PreRotation ).multiplyScalar( Math.PI / 180 );
returnObject.preRotations = new THREE.Euler().setFromVector3( preRotations, order );
}
break;
}
}
`
After #12411 and #14933 rotation order should be fully supported in the loader, so this can be closed.
Most helpful comment
I'll look into it over the next couple of days.
@ignazioa if you could share some model (preferably very simple ones) with different rotation order that I can use for testing that would speed things up.