# Switch Matrix from y-UP to z-Up

**URL:** <https://discourse.threejs.org/t/switch-matrix-from-y-up-to-z-up/13331>\
**Category:** Questions\
**Tags:** transform\
**Created:** [March 6, 2020, 3:09pm UTC](https://discourse.threejs.org/t/switch-matrix-from-y-up-to-z-up/13331 "2020-03-06T15:09:53Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![blackInk](https://avatars.discourse-cdn.com/v4/letter/b/c2a13f/32.png) [@blackInk](https://discourse.threejs.org/u/blackInk)\
**Post date:** [March 6, 2020, 3:09pm UTC](https://discourse.threejs.org/t/switch-matrix-from-y-up-to-z-up/13331/1 "2020-03-06T15:09:53Z")

</div>

Hi,

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:

```auto
{ 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:

```auto
{ 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](https://stackoverflow.com/questions/1263072/changing-a-matrix-from-right-handed-to-left-handed-coordinate-system)) but still it seems not right?

---

<div class="post-metadata">

**Author:** ![Mugen87](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.threejs.org/mugen87/32/5645_2.png) [@Mugen87](https://discourse.threejs.org/u/Mugen87)\
**Post date:** [March 6, 2020, 3:29pm UTC](https://discourse.threejs.org/t/switch-matrix-from-y-up-to-z-up/13331/2 "2020-03-06T15:29:56Z")

</div>

I suggest you study the conversation in: [Convert from one coordinate system to another?](https://discourse.threejs.org/t/convert-from-one-coordinate-system-to-another/13240)

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](https://discourse.threejs.org/t/convert-from-one-coordinate-system-to-another/13240/10).

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