Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Autogenerate bezier curve with a given direction
#1
Hello, I am trying to figure out how to have a bezier curve be generated based on two control points angles/direction given by the user. The image below basically gives a rough idea of what I'm trying to go for.

[Image: g5Ju4Dy]

I see that auto handle creates nice smooth curves, so is there a way to allow certain directions the control points have to face?
Any suggestions would be great Smile
Reply
#2
Hi
I think you should set Auto Handles to false, and then set the handles like in the picture you posted. Try first doing that via the editor, and if it gives good results, then you can try generating the handles' direction, based on the angle, via the API
Did that help?
Please consider leaving a review for Curvy, this helps immensely. Thank you.
Available for freelance work—feel free to reach out.
Reply
#3
Yeah, I think the problem I'm having specifically would be generating the handles in the specific direction where the bezier curve also creates a realistic path, because I was going to have a vehicle follow it. I think the math/idea might be way too complex, so I'm probably just gonna let the user manually move the handles to their desire angles/location. Thanks for the help, I will let you know if I make any breakthroughs!
Reply
#4
If you inputs are the angles (30°, 180°, ...) then finding the direction of the handles is easy: x = sin(angle) and y = cos(angle). Then comes the question of the ideal length of the handles. For that I don't have an answer
Please consider leaving a review for Curvy, this helps immensely. Thank you.
Available for freelance work—feel free to reach out.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Extrapolate past curve endpoint Madgvox 3 9 09-10-2024, 01:24 PM
Last Post: _Aka_
  snap to the curve created by the curvy splines segment points ShiroeYamamoto 3 11 04-02-2024, 02:24 PM
Last Post: _Aka_
  Can Curve Spline be used for an in game level editor. Lupos 30 75 06-03-2023, 10:58 AM
Last Post: _Aka_
  How to get direction of last control point? _RicO 4 26 04-13-2023, 11:27 AM
Last Post: _Aka_

Forum Jump: