How to convert decomposed transformations between different coordinate systems? I am converting some Unity3D scenes to a proprietary json format to be used by my OpenGL renderer that uses a different coordinate system from Unity's.

I have multiple sets of {translation, rotation(quat), scale} pairs that describe some node transformations. The engine that uses them (Unity) uses the positive x-axis looking to the right, the positive y-axis looking up and the positive z-axis looking front.

I want to convert each pair into a {new_translation, new_rotation(quat), new_scale} in order to use them in my engine using the same coordinate convention with the z-axis inverted (positive z-axis looking back, the most common OpenGL convention).

How should the new pairs be constructed?
Maybe not the best solution but one that should work would be to multiply them by matrix like
\begin{bmatrix}-1&amp;0&amp;0\\0&amp;1&amp;0\\0&amp;0&amp;-1\end{bmatrix}
And multiply by this your mvp matrix to convert meshes vertices (this could be done offline).
Quaternion can be change to matrix form, multiply and save as quaternion.
You also need to change culling in OpenGL because triangle order will be inverted.
I did this in one project and it works fine. If I will find this project I will write something more about it.
//EDIT
This matrix will invert your Z-axis and X-axis
//EDIT2
To apply this solution to each to component you need to:

Change translation x and z component to -x and -z.

Rotation in matrix form multiply by matrix above and change it to quaternion.

Scale leave how it is.
4. Iterate through all meshes and multiply each of their vertices by this matrix.


//EDIT3
Instead of matrix you can just multiply rotation by quaternion (0, 0, 1, 0) (in order (w, x, y, z)) and new quaternion will look like this: (-y,z,w,-x). This operation (and matrix too) just rotate object by 180 degree in y-axis.