Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Keeping a fixed spline length
Hi there,

Let's say I have a spline with several control points. I would like to be able to move those control points by small amounts but keep the spline at a constant length (during runtime).

I'm fine with moving the control points etc but the spline "stretches" of course when the points are moved. I guess my question is:

1. Is there a way to "set" the length of a spline? How would I calculate where one of the end control points needs to be so that the spline length was a certain value?

Thank you for any help you can provide.

There is no feature in Curvy Splines that allows that.
There might be mathematical ways (that could then be implemented in C#) to extend/shrink a spline by a specific length. I can't say for sure, I have never searched for this seriously. If this exists, it surely will not be applicable the same way on all the spline types Curvy Spline handles, so you have to search for the type of splines your project is using.
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.
Ok thank you anyway.

To maintain a constant spline length while adjusting control points, you can use a numerical method. Implement an algorithm that adjusts the positions of control points iteratively, ensuring the spline length matches your desired value. Utilize techniques like gradient descent or Newton's method to update control point positions based on length constraints.

Possibly Related Threads…
Thread Author Replies Views Last Post
  GO can't fit end of the spline GameDeveloperek4123 1 4 02-13-2024, 10:18 AM
Last Post: _Aka_
  How could I get position in spline from "From" value in BuildRasterizedPath? Chanon 1 6 02-12-2024, 09:54 PM
Last Post: _Aka_
  Add noise to spline controller movement DekoGames 2 8 02-06-2024, 01:28 PM
Last Post: DekoGames
  Line Renderer between two objects on a spline travellinggamedev 1 5 01-13-2024, 10:39 AM
Last Post: _Aka_

Forum Jump: