如题

解决方案 »

  1.   

    如果你说的B样条的deboor算法递推公式,我可以告诉你,但是牵涉到公式符号不能写,又不能粘贴图像,所以没法在这发给你,我建议你随便找本图形学的书,只要里边有B样条的肯定都有这个公式。
      

  2.   

    POINT CTestsplineView::deboor(int degree, POINT coeff[], float knot[], float u, int i)
    {
    int k,j;
    float t1,t2;
    POINT coeffa[30]; for(j=i-degree+1;j<i+1;j++)
    {
    coeffa[j].x = coeff[j-i+degree-1].x;
    coeffa[j].y = coeff[j-i+degree-1].y;
    } for(k=1;k<degree;k++)
    {
    for(j=i;j>=i-degree+k+1;j--)
    {
    t1=(knot[j+degree-k]-u)/(knot[j+degree-k]-knot[j]);
    t2=1.0-t1;
    coeffa[j].x = t1*coeffa[j-1].x + t2*coeffa[j].x;
    coeffa[j].y = t1*coeffa[j-1].y + t2*coeffa[j].y;
    }
    }
    return (coeffa[i]);
    }