Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Keeping a fixed spline length
#1
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.

John
Reply
#2
Hi
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.
Reply
#3
Ok thank you anyway.

John
Reply
#4
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.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Curvy Line Renderer for UI Spline? gekido 3 6 04-04-2024, 12:56 PM
Last Post: _Aka_
  Get position of all control points for a spline gekido 1 6 03-28-2024, 10:08 PM
Last Post: _Aka_
Bug Changing spline connection in inspector causes splines to revert to defaults lacota 3 6 03-18-2024, 07:55 PM
Last Post: _Aka_
  GO can't fit end of the spline GameDeveloperek4123 3 14 03-04-2024, 11:06 AM
Last Post: _Aka_

Forum Jump: