开发者

Inverse Interpolation with angles greater than Pi?

I'm making an API for skeletal animation. Right now it works fine, except Lets say you want to go from 2.0f to 1.0f. It will end up doing almost a full circle when it should only do about 1/6th of one.

I think I've got a way to find it it should go counter clockwise but I'm not sure how to use it with this:

    bool CCW = fmod( (endKeyFrame->getAngle() - 
            startKeyFrame->getAngle() + TWO_PI), TWO_PI) > 3.141592;


        remainingInterpolationFrames = endKeyFrame->getFrame() - startKeyFrame->getFrame();

        //Linear interpolation

            curIncreaseAngle = (endKeyFrame->getAngle() - 
                startKeyFrame->getAngle()) / r开发者_运维技巧emainingInterpolationFrames;

Thanks


I think this may help. Especially sections 8,9 and 30.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜