Switch Matrix from y-UP to z-Up


I need to switch a matrix in Threejs from being z-Up to y-Up and back? It seems I´m failing miserable.

I thought it was something like:

{ rx, ry, rz, 0 }  
{ ux, uy, uz, 0 }  
{ lx, ly, lz, 0 }  
{ px, py, pz, 1 }

To change it from left to right or right to left, flip it like this:

{ rx, rz, ry, 0 }  
{ lx, lz, ly, 0 }  
{ ux, uz, uy, 0 }  
{ px, pz, py, 1 }

…found here (https://stackoverflow.com/questions/1263072/changing-a-matrix-from-right-handed-to-left-handed-coordinate-system) but still it seems not right?

I suggest you study the conversation in: Convert from one coordinate system to another?

Note that also the handedness is important (left vs. right). You should find ready-to-use code for the conversion from right-handed Z-up to right-handed Y-up here.

By inverting the change-of-basis matrix, you should be able to perform the opposed operation.