Page 2 of 2 FirstFirst 12
Results 11 to 13 of 13

Thread: Bezier curves

  1. #11

    Bezier curves

    There is only point coordinates, no normals in the formula though But yeah it's well worth try method too.

  2. #12
    Legendary Member NecroDOME's Avatar
    Join Date
    Mar 2004
    Location
    The Netherlands, Eindhoven
    Posts
    1,059

    Bezier curves

    Nice! its also something I still wanted to implement since NecroSPACE 2
    NecroSOFT - End of line -

  3. #13

    Bezier curves

    Like this image showed:
    http://www.mvps.org/directx/articles...es/spline1.gif
    Desired point is in the middle, between second and third point. So the end points are there to just show where to twist

    As you see here, only middle section is what we need:


    Code:
    function nxCatmull(const a,b,c,d: PVector3f; const delta: single): TVector3f;
      function Calc(p0,p1,p2,p3,t: single): single;
      begin
        result:=0.5 *( (2 * p1) + (-p0 + p2) * t +
         (2*p0 - 5*p1 + 4*p2 - p3) * t*t +
         (-p0 + 3*p1- 3*p2 + p3) * t*t*t);
      end;
    begin
      result.x:=Calc(a.x, b.x, c.x, d.x, delta);
      result.y:=Calc(a.y, b.y, c.y, d.y, delta);
      result.z:=Calc(a.z, b.z, c.z, d.z, delta);
    end;
    PS. I really like seeing these twist in 3 dimensions real time

    PPS. Here's what you get when combining the middle sections It's exactly the way the curve is supposed to go! Now is it fast enough for real models?
    http://img512.imageshack.us/img512/3514/catmull2kp4.jpg
    Last edited by User137; 11-04-2011 at 03:28 PM.

Page 2 of 2 FirstFirst 12

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •