Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Closest Point on Spline (+Offset) to some World Position
#8
(01-25-2018, 02:15 AM)nomadigi Wrote: It seems like carTf is not increasing linearly.

It is indeed not linear in most cases, and this is normal.
If your are curious about why, take a look at this Wikipedia page, and notice how, in most cases, the point travels with different speeds depending if it is around the spline middle or around it's end.

So, your solution (setting the spline to linear) is not really one, since it will work only on linear splines. If you have a curved spline, you will meet the same problem again.

The real issue comes from how you define your car position:
Code:
float roadPosition = carTf * RoadSpline.Length;
It should be instead
Code:
float roadPosition = RoadSpline.TFToDistance(carTf)

Splines have often different versions of the same methods, one taking TFs as an input, and the other taking distances.

Let me know if this doesn't help.
Available for freelance work, feel free to reach out: toolbuddy.net
Please consider leaving a review for Curvy, this helps immensely. Thank you.
Reply


Messages In This Thread
RE: Closest Point on Spline (+Offset) to some World Position - by _Aka_ - 01-25-2018, 01:24 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Best way to duplicate a spline with an offset Kapistijn 8 1,424 04-12-2026, 03:18 PM
Last Post: _Aka_
  Control Point Interpolation Overrides. rickgplus 1 560 12-11-2025, 08:52 AM
Last Post: _Aka_
Smile Constant speed along a spline? tfishell 1 665 11-13-2025, 11:32 AM
Last Post: _Aka_
  SplineController Ignores Follow-Up and Chooses Wrong Spline Josenildo 7 4,476 07-29-2025, 09:15 PM
Last Post: _Aka_

Forum Jump: