Calculate quaternion rotations between two values

I have a quaternion Q1:
X: -0.023995593190193176 Y: -0.4076451063156128 Z: 0.04357096180319786 W: 0.9117847681045532

and I have a keyframe value Q2 which is based on Q1: X: 0.176469 Y: -0.368251 Z: 0.479782 W: 0.776569

Now my question is how can I get the correct keyframe values if there would be no extra start values ? I mean if Q1 is 1,0,0,0 (w,x,y,z). (no extra start values) So basically I need to rotate my object to the same pose but from the default values (1,0,0,0) start not from Q1.

Is there a C question or is this a math question?

We occasionally do answer math questions... can you read mathspeak and get what you need from https://en.wikipedia.org/wiki/Quaternions_and_spatial_rotation ?

Unless I am not getting something (this happens a lot), the rotation math should be the same, whether you rotate about Q1 or default, right? Can't you just do whatever you were doing for Q2 by Q1 and make it Q2 by default?

if you are not at an anomaly, you can also just use 3-d rotations and cook the final Q at the end. If you are at an anomaly, you have to use the Qs. I don't remember if this is worth checking and handling differently or if its more efficient to just always do the Qs...

I am also pretty sure you can use the rotation matrix approach with Qs but it may be trickier to set it up. I have never tried this, though, is just a stray thought.

just to be extra clear, you just want the rotation from default to Q2 ... if that is correct, I will try to look at it tonight (I can't do this one at work, I don't think in 4d well. )
Last edited on
Thank you for your reply !

Yeah it was a math question (I posted here because I couldn't find any section for math things). I also asked this at stackexchange.com and it was finally answered correctly: https://gamedev.stackexchange.com/questions/159898/calculate-quaternion-rotations-between-two-values/
OK, so you got it? Nice!
Sorry, I haven't looked at those in about 10 years (and of all things I wrote that program in visual fortran), was going to have to pen and paper it so glad someone else was able to unravel it.
Topic archived. No new replies allowed.