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
  Spline deformation & Bezier spline connection alignment digot 7 1,169 04-18-2021, 03:39 PM
Last Post: _Aka_
  get a point on the curve a distance away from another fortune53 1 510 03-31-2021, 07:46 AM
Last Post: _Aka_
  How to add a new point with a smooth curve? athos_k 4 1,010 03-22-2021, 09:10 AM
Last Post: _Aka_
  how to change the look direction of a character at end of path ninadpradhan 1 636 12-16-2020, 09:30 AM
Last Post: _Aka_

Forum Jump: