“Average” of multiple quaternions?

前端 未结 13 1618
执念已碎
执念已碎 2020-12-12 17:31

I\'m trying to make the switch from matrices to quaternions for skeletal animation in my OpenGL program, but I\'ve encountered a problem:

Given a number of unit quat

13条回答
  •  醉梦人生
    2020-12-12 17:35

    There is a technical report from 2001 which states that the mean is actually quite a good approximation, provided that the quaternions lie close together. (for the case of -q=q, you could just flip the ones that point in the other direction by pre multiplying them by -1, so that all of the quaternions involved life in the same half sphere.

    An even better approach is sketched in this paper from 2007, which involves using an SVD. This is the same paper that Nathan referenced. I would like to add that there is not just a C++, but also a Matlab implementation. From executing the test script which comes with the matlab code, I can say that it gives quite good results for small pertubations (0.004 * uniform noise) of the quaternions involved:

    qinit=rand(4,1);
    Q=repmat(qinit,1,10);
    
    % apply small perturbation to the quaternions 
    perturb=0.004;
    Q2=Q+rand(size(Q))*perturb;
    

提交回复
热议问题