0

I am using the CatmullRomSpline class of libgdx for creating a smooth curve passing through three points. Basically I want to place coins between two platforms in a curved path. For that I followed the following algorithm reference image

  • Take the end top point of first platform as the first control point;

  • Take the middle point bw top end of first platform and top start of second platform , add a little height to it in y direction and take this point as second control point.

  • Take the top start point as second platform as third control point.

Now when I am trying to create a smooth path for my coin generation using these three control points, I just get one value what so ever t is use (CatmullRomSpline uses a float value t as parameter which has to vary bw 0 and 1).

Is there something I am missing . Is it that I need to provide more control points ?

Rahul Verma
  • 2,140
  • 3
  • 21
  • 31
  • 1
    There's a good explanation here: http://stackoverflow.com/questions/1085617/catmull-rom-splines-how-do-they-work – R Hyde Sep 22 '14 at 07:05
  • 1
    Try duplicating the first and last point (or even better, add points below the first and last point) – Xoppa Sep 22 '14 at 15:53

0 Answers0