Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Getting a location above the spline
#2
Hi

There is no ready out of the box solution for this issue in Curvy Splines. You will have to code something. Here is what seems to me like a good logic to implement:
Simplify the problem by restricting it to the XZ plane (this means you will have to project the ray on that plane). Then find the nearest point on the spline from that ray. Then finally restore the Y coordinate to get the point on the real XYZ ray.

About finding the nearest point from the spline to the ray. There might be an optimized way to do it that I am not aware of, but an easy way would be to test multiple points on the ray and compute their distance from the spline. To do so use GetNearestPoint and compute the distance between the result point an the ray point. To reduce the number of points tested, if their high number is an issue, you can use some optimization strategy such as Binary Search.

I hope this helped
Have a nice day
Please consider leaving a review for Curvy Splines, this helps immensely. Thank you.
Reply


Messages In This Thread
Getting a location above the spline - by EeSe01 - 07-11-2023, 08:10 AM
RE: Getting a location above the spline - by _Aka_ - 07-11-2023, 09:30 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Spline Issue Leading to Unity Freeze Pankaj09 1 227 08-24-2026, 11:28 PM
Last Post: _Aka_
  Connecting Multiple Spline Nodes Issue Ritesh Kadam 1 179 08-22-2026, 11:24 PM
Last Post: _Aka_
  Spline Spots from 2 samples. BitBlit 8 1,113 06-30-2026, 11:49 AM
Last Post: _Aka_
  Best way to duplicate a spline with an offset Kapistijn 8 2,510 04-12-2026, 03:18 PM
Last Post: _Aka_

Forum Jump: