Godot Version
4.6
Question
Is there an easy way to get the index of the two closest points to another point on a Curve3D?
Basically I want the index of the original points a random point on the curve falls between.
I assume I could loop over the original points and check the distance between each and the closest point returned by get_closest_point until I find the index of the closest two?
To save gertkeno having to link to XY problem
The underlying thing Iām trying to do relates to my older post Calculate the curve angle of a Path3D to calculate ācentrifugal forceā? - #3 by gentlemanhal Yes, Iām still having trouble finding a nice way to apply tilt to my trains on corners. I got something working that was good enough, until I introduced grades (i.e. the track going up and down on the Y axis)
Iām thinking maybe if I get the original control points Iād be able to calculate the tangent to the curve? ![]()