问题如题目!
    已知三次Bezier曲线四个控制点的情况下求出Bezier曲线的长度?兄弟们帮忙顶一下!

解决方案 »

  1.   

    好像挺难的。。The generic formula for a parametric curve length isSum[0,1]( sqrt((dx/dt)^2+(dy/dt)^2+(dz/dt)^2)*dt )BTW, to "verify", for a classical function curve y=f(x), just replace t by x, discard z and you get Sum[xa,xb]( sqrt(1+(dy/dx)^2)*dx )Since your Bezier spline is of degree 3, dx/dt is of degree 2. (dx/dt)^2 is of degree 4, etc ... All in all you end up with the integration of the square root of a degree 4 polynomial in t.Then there should be enough litterature on the www for you concerning numerical or formal integration techniques. But this can easilly be solved formally :Go there http://torte.cs.berkeley.edu:8010/tilu and you'll get the formal answer you need. Select Mathematica as language and type (indefinite integration : finding a primitive):sqrt(a*x^4+b*x^3+c*x^2+d*x+e)You'll get (control by differentiating the result, it's easy):             5          4          2          3
    sqrt (1/5 a x  + 1/4 b x  + 1/2 d x  + 1/3 c x  + e x)And in fact replace x by 1 since you just integrated between 0 and 1 and this makes 0 at 0.length = sqrt(1/5a + 1/4b + 1/2d + 1/3c + e)I hope you understood how to get a, b, c, d and e from your spline.With a quick SSE or 3DNow sqrt or the "Carmack" sqrt, you can have both precision and speed. Google with Gamedev search engine to know more about quick sqrts.
      

  2.   

    I hope you understood~~
      

  3.   

    把曲线分成多条符合精度要求的直线再累加
    至于怎么分这方面的资料网上很多
    http://eduinfo.hust.edu.cn/old/kjzz/gjcbs/jsj/jsjtxx/Chapter3/CG_Txt_3_001.htm
      

  4.   

    三次Bezer曲线看起来很诡异么,左右可以乱晃