Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
interpolate to nth control point
I have a spline with a number of control points.  I can go from one control point to an adjacent control point via Interpolate(% progress, worldSpace).  Works fine. 

My initial take on going from CP0 => CP3 was getting CP3 control point & calling Interpolate from that CP.  What am I missing here?  Thanks. 

  var nextControlPoint = Spline.ControlPointsList[_icp+3];
  transform.position = nextControlPoint.Interpolate(percentCompletion, Space.World);
When you use a someControlPoint.Interpolate, you have a position between that control point and the next one, so cp3.Interpolate returns a position between cp3 and cp4
Also, the first parameter is not a %. Please read the method's documentation to understand what that parameter means. More information here:]=tf#units
Each control point has a Distance and TF values. You also have a InterpolateByDistance method. The max value of TF is 1 and the max value of Distance is Spline.Length. With all this information you should be able to find any point at any position on the spline.
I hope this helped
Have a nice day
Please consider leaving a review for Curvy. This will help a lot keeping Curvy relevant in the eyes of the Asset Store algorithm.

Possibly Related Threads…
Thread Author Replies Views Last Post
  Allow to control Global Illumination settings in CreateMesh node of PathGenerator RobinB 2 187 11-02-2021, 08:50 AM
Last Post: RobinB
Question Generating a path from selected point to the beginning of spline on a closed spline? Zendariel 5 330 10-29-2021, 01:57 PM
Last Post: _Aka_
  Control of an object that uses a spline ricke 5 532 09-16-2021, 10:30 AM
Last Post: _Aka_
  Split existing segment(s) with additional control points KStress71 1 249 09-09-2021, 05:46 PM
Last Post: _Aka_

Forum Jump: