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
  Simple Spline Extrusion GelsonBieber 3 319 07-29-2020, 02:34 PM
Last Post: _Aka_
Shocked Spline always going up into the air? jamesunity 6 193 07-20-2020, 08:32 PM
Last Post: _Aka_
  Make GameObject Face towards Spline Path linkinballzpokemon 5 191 07-14-2020, 08:27 PM
Last Post: _Aka_
  Question regarding Spline Generated Path linkinballzpokemon 9 485 07-01-2020, 06:10 PM
Last Post: _Aka_

Forum Jump: