I am trying to slerp between 2 quaternions using Eigen(thought would be the easiest).
I found two different examples
One,
for(int i = 0; i < list.size(); i++)
{
Matrix3f m;
Quaternion<float,0> q1 = m.toRotationMatrix();
Quaternion<float,0> q3(q1.slerp(1,q2));
m_node->Rotation(q3.toRotationMatrix());
}
Second,
Vec3 slerp(const Vec3& a, const Vec3& b, const Real& t)
{
Quaternionf qa;
Quaternionf qb;
qa = Quaternionf::Identity();
qb.setFromTwoVectors(a,b);
return (qa.slerp(t,qb)) * a;
}
I cant really say which one is correct. There is not many documentation about this. Can anyone tell me if I should use a different library? or how can I slerp using eigen.