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 will help a lot keeping Curvy relevant in the eyes of the Asset Store algorithm.
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 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
  snap to the curve created by the curvy splines segment points ShiroeYamamoto 0 1 9 hours ago
Last Post: ShiroeYamamoto
  Can Curve Spline be used for an in game level editor. Lupos 30 71 06-03-2023, 10:58 AM
Last Post: _Aka_
  How to get direction of last control point? _RicO 4 23 04-13-2023, 11:27 AM
Last Post: _Aka_
Bug Extrusion and scale curve issues Sacryn 3 15 04-08-2022, 12:30 PM
Last Post: _Aka_

Forum Jump: