Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to calculate curvature of spline
#1
Hi there,

Please can you help, I'm trying to create a spline between two points but with a certain curvature. This would be at runtime (if that matters).

My example, suppose I have a curved train track piece. I know the start point of the piece, and I know the end point of the piece, and I know the radius or curve of the piece. How then would I "bend" my spline so it connects the start/end points and matches the curve of the track piece?

I don't think I can use Conform Path because the collider is a box collider around the whole piece so it doesn't match the size or curve of the piece.

Thank you for your time

John
Reply
#2
Hi,
By using Bézier splines (set the Interpolation parameter in a spline to Bezier), you can set the handles at each control point, allowing you to set precisely the shape you want. The handles' positions and the control points' positions are what define a shape of a Bézier spline. You can look on the internet about how to represent the shape you desire as a Bézier spline, then use the found formulas to set the right values on your Curvy spline. For example, here is how to define a circle: https://spencermortensen.com/articles/bezier-circle/
Keep in mind that Curvy already comes with a pre-made shapes, including circles. You can create them using the Create button in the toolbar: https://curvyeditor.com/documentation/toolbar#create
Did this help?
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
Hi and thank you for the quick response.

Yes this is very helpful.

John
Reply
#4
You are welcome. Feel free to leave a review on the asset store, that helps. Thanks and 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


Possibly Related Threads…
Thread Author Replies Views Last Post
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 13 03-04-2024, 11:06 AM
Last Post: _Aka_
  Keeping a fixed spline length jh092 3 16 02-21-2024, 06:25 AM
Last Post: Primrose44
  How could I get position in spline from "From" value in BuildRasterizedPath? Chanon 1 8 02-12-2024, 09:54 PM
Last Post: _Aka_

Forum Jump: