0

I have a rotation matrix where right is +x, up is +y, and forward is -z. This is the standard OpenGL principal axes.

I need to express this rotation matrix in a new coordinate system where down is +y and forward is +z. So, the new system has axes for y and z flipped.

My current strategy was to use this formula.

rotation a = get_rotation();
rotation b = rotation(
    1,  0,  0,
    0, -1,  0,
    0,  0, -1
);

a = b * a * transpose(b);

Though this seems to yield incorrect results.

What would be the proper way to transform a rotation matrix from one reference frame to another?

Cecil
  • 135
  • 7
  • see [Understanding 4x4 homogenous transform matrices](https://stackoverflow.com/a/28084380/2521214) you can simply negate the basis vectors you want directly in the matrix without any transforms... – Spektre Jul 16 '19 at 07:51

1 Answers1

0

In a = b * a * transpose(b) the multiply by b and transpose(b) will cancel each other out. i.e. the center matrix element would multiply by (-1) twice.

Have you tried a = b * a instead?

fifoforlifo
  • 724
  • 5
  • 9