Inverse Interpolation with angles greater than Pi?

六月ゝ 毕业季﹏ 提交于 2020-01-25 11:27: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.



来源:https://stackoverflow.com/questions/6147839/inverse-interpolation-with-angles-greater-than-pi

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!