# Quaternion - switching from right-handed to left-handed

I have a rotation quaternion in my 3D model and it uses the right-handed coordinate system. Now I'd like to convert it into a left-handed since my game engine (Unity) uses left-handed.

These are the axis in my 3D model

while these are the axis in my destination engine

I read around that first I need to negate the imaginary part and then apply a $M$ matrix that will convert between right-handed and left-handed. For the case above I tried with

$q_{rh} = q0 + q_1i + q_2j + q_3k$

$M = \begin{bmatrix}-1 & 0 & 0\\0 & 0 & 1\\0 & 1 & 0\end{bmatrix}$

$q_{lh} = q0 + q_1i - q_3j - q_2k$

but the animation I set up didn't work anymore. Am I getting something wrong? To add more context: I imported the model switching the sign of the X axis for all of its vertices.

• If you're negating the imaginary part, you should have $$q_{\ell h} = q_0 \color{red}- q_1i -q_2j - q_3k$$ – Omnomnomnom Feb 8 '17 at 17:04
• @Omnomnomnom how come? I thought I should first get all negatives and then multiply by that matrix (so $q_1$ would become positive again) – Dean Feb 8 '17 at 20:04
• Well, you can compare that to the output of multiplying $q_{rh}$ by $M$ – Omnomnomnom Feb 8 '17 at 20:08
• @Omnomnomnom That would be the complex conjugate I suppose, but I still don't get it – Dean Feb 8 '17 at 20:14
• I think that all the bit you read is saying is that to flip the coordinate system, just take the conjugate of your quaternion before applying the usual computations. – Omnomnomnom Feb 8 '17 at 20:18