Re: importing motion paths

New Message Reply Date view Thread view Subject view Author view

Michael Boccara (boccara++at++MIT.EDU)
Fri, 11 Sep 1998 10:53:51 -0700


Geoff,

If you don't mind about computing splines "by hand", I have a formula to compute
cubic splines interpolation from a set of pass-through points (Mi) and
associated velocity vectors (Vi), at times (ti).
Each spline segment can be computed at a "point-after-point" basis.

Be M1, V1, M2, V2, the position and velocity vectors at times t1 and t2.
Be t a time between t1 and t2

the segment index for time t :
   u = (t - t1) / (t2 - t1);
Spline vector polynom for the (t1, t2) segment
    A = (V1 + V2) * DT - 2 * (M2 - M1);
    B = - (2 * V1 + V2) * DT + 3 * (M2 - M1);
    C = V1 * DT;
    D = M1;
(DT = t2 - t1)
Interpolated position at time t between [t1, t2] :
    M(t) = A * u * u * u + B * u * u + C * u + D;
   
So smooth !

Those results can easily be found by
1/ derivating the above polynom,
2/ applying the t1 and t2 edge constraints at 1st and 2nd order,
3/ and inverting a 4x4 matrix to eventually find A,B,C,D.

Hope it helps,

Mike

-- 
___________________________________________________________________
Michael Boccara     Massachusetts Institute of Technology
                    Research Laboratory of Electronics
(617) 253 0005      Virtual Environment Technologies for Training

New Message Reply Date view Thread view Subject view Author view

This archive was generated by hypermail 2.0b2 on Fri Sep 11 1998 - 07:52:42 PDT

This message has been cleansed for anti-spam protection. Replace '++at++' in any mail addresses with the '@' symbol.