Hello,
I have a problem with calculating multiple quaternions between 2 quaternions.
Example on the image:
Q1 has localEulerAngles.y at 7
Q4 has localEulerAngles.y at -17.4
I can get center quaternion between Q1 and Q4 for example by:
Quaternion.Slerp(Q1.transform.localRotation, Q4.transform.localRotation, 0.5f);
And it gives me “-5.2” value - which is great if I want only one quaternion in between Q1 and Q4.
But what if I want more quaternions?
Slerp of Q1,“-5.2” and Q4,“-5.2” is not it - they are off center a little if you think about it.
Thanks in advance
I’m now sure i understand the problem, you can just call slerp again with a different t parameter.
var v1 = Quaternion.Slerp(Q1.transform.localRotation, Q4.transform.localRotation, 1/3);
var v2 = Quaternion.Slerp(Q1.transform.localRotation, Q4.transform.localRotation, 2/3);
Enignum
3
Ouuuu… didn’t think of just changing t parameter… simple.
Turned out it still didn’t solve my problem completely but a bit of progress is made
Thanks!
tjmaul
4
If that the spacing is not correct for whatever effect you’d like to achieve, use Quaternion.Lerp, which is a linear interpolation