I'm not a math wizzard, so I can't explain how I came up with the following code (it was pure hack : try something, see if it works, etc. ^^) But I've been using it for more than half a year now, and it works.
Here's a piece of code I use in my exporter :
// transform each vertexfor (unsigned int v = 0; v < m_VertexList.GetNum(); v++){ m_VertexList[v].position.x = -m_VertexList[v].position.x; m_VertexList[v].normal.x = -m_VertexList[v].normal.x;}// ...// extract the transformations from the transformtransform.getRotation(eulerRotation);transform.getScale(scale);translation = transform.translation(MSpace::kWorld);// convert it to left handed :// - negate translation along X// - negate rotations around Y and Ztranslation.x = -translation.x;eulerRotation.y = -eulerRotation.y;eulerRotation.z = -eulerRotation.z;// rebuild a transformtion matrix from the modified transformationsMTransformationMatrix transformationMatrix;transformationMatrix = transformationMatrix.identity;transformationMatrix.rotateBy(eulerRotation, MSpace::kWorld);transformationMatrix.setScale(scale, MSpace::kObject);transformationMatrix.setTranslation(translation, MSpace::kWorld);
It's the same as you do. I think that when we switch from right to left handed systems, the rotation orders change. So we should invert all rotations. BUT we also have to invert 1 axis. So, inverting this axis and inverting the rotation around it would give the same rotation. That's why, if we invert X, we only need to invert rotations around Y and Z.
I'm pretty sur that if we add to invert the Y axis (for example), we would have to invert rotations around X and Z.
That's the only explanation I can find with the pieces of math I still remember from my studies ^^