-->

Inverse Interpolation with angles greater than Pi?

2019-09-19 05:06发布

问题:

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()) / remainingInterpolationFrames;

Thanks

回答1:

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



标签: c++ math