插值

以下插值算法参考自wmo,可能有优化余地

 

线性插值:

r(取值范围 0~1)

v1、v2

v1 * ( 1f – r) + v2 * r

 

埃尔米特插值:

r、v1、v2、in、out

h1= 2f * r * r * r – 3f  * r * r +1f

h2= -2f * r * r * r + 3f  * r * r

h3= r * r * r – 2f * r * r + r

h4= r * r * r – r * r

v1 * h1 + v2 * h2 + in * h3 + out * h4

贝赛尔曲线插值:

r、v1、v2、in、out

inverseFactor = 1f – r

factorTimesTwo = r * r

inverseFactorTimesTwo = inverseFactor * inverseFactor

 

h1 = inverseFactorTimesTwo * inverseFactor

h2 = 3f * r * inverseFactorTimesTwo;

h3 = 3f * factorTimesTwo * inverseFactor;

h4 = factorTimesTwo * r

v1 * h1 + v2 * h2 + in * h3 + out * h4

 

四元数线性插值默认使用slerp函数

 

发表评论?

0 条评论。

发表评论


注意 - 你可以用以下 HTML tags and attributes:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>