Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
smooth connection of two splines.
#1
Great plugin! Thanks for your work.
5.1.0
Just starting to figure it out. But I just can not realize such a thing. I spawn the pre-made splines of which create the path along which the spaceship is flying. On their connection, I create a connection, set the flags for synchronizing position and rotation. So I set the pivot point for the spline to the first point, trying to rotate the next spline relative to the angle of rotation of the last and first point of the splines (baked orientation). But just can not connect them seamlessly. the position is the same but with the angle all the time something is wrong. Is there any way to precisely rotation the next spline?
A bit of visualization in the attachment )


Attached Files Thumbnail(s)
   
Reply
#2
Hi,
Thank you, for the compliment. Glad you like it.
Can you send me the scene please?
Thanks and have a nice day
Available for freelance work, feel free to reach out: toolbuddy.net
Please consider leaving a review for Curvy, this helps immensely. Thank you.
Reply
#3
The solution is to compute the second spline's orientation in such way that the last tangent of the first spline is alligned with the first tangent of the second. I will PM you with a modified version of your code
Available for freelance work, feel free to reach out: toolbuddy.net
Please consider leaving a review for Curvy, this helps immensely. Thank you.
Reply
#4
Dear _Aka_

Sorry to revive an old post.

But is it possible to share that solution ?

I've tried to use CurvyConenctions to link two points from different splines, however I do not know how to alter their respective tangents to achieve the desired effect as explained by Lukango.

Thanks in advance for your time.
Kind Regards

Mario
Reply
#5
Hi,
Here is the relevant part of the code I send to Lukango

Code:
//Refresh splines to have the tangent information available and up to date
lastSpline.Refresh();
newSpline.Refresh();

var lastTangent = lastSpline.transform.TransformDirection(lastSpline.GetTangent(1));
var firstTangent = newSpline.transform.TransformDirection(newSpline.GetTangent(0));
//rotate the newSpline so that its first tangent aligns with lastSpline's last tangent
newSpline.transform.rotation = newSpline.transform.rotation * Quaternion.FromToRotation(firstTangent, lastTangent);

Is it clear to you?
Have a nice day
Available for freelance work, feel free to reach out: toolbuddy.net
Please consider leaving a review for Curvy, this helps immensely. Thank you.
Reply
#6
(09-11-2019, 10:13 PM)_Aka_ Wrote: Hi,
Here is the relevant part of the code I send to Lukango

Code:
//Refresh splines to have the tangent information available and up to date
lastSpline.Refresh();
newSpline.Refresh();

var lastTangent = lastSpline.transform.TransformDirection(lastSpline.GetTangent(1));
var firstTangent = newSpline.transform.TransformDirection(newSpline.GetTangent(0));
//rotate the newSpline so that its first tangent aligns with lastSpline's last tangent
newSpline.transform.rotation = newSpline.transform.rotation * Quaternion.FromToRotation(firstTangent, lastTangent);

Is it clear to you?
Have a nice day



Dear Aka,

Thanks for the code, it does makes sense. 

All the best
Mario
Reply
#7
Thank you
Available for freelance work, feel free to reach out: toolbuddy.net
Please consider leaving a review for Curvy, this helps immensely. Thank you.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
Lightbulb Junction & Connection Navigation System Design SAMYTHEBIGJUICY 6 3,186 03-25-2026, 10:10 PM
Last Post: _Aka_
  Bezier subdevision not smooth (sometimes) Kapistijn 1 397 02-08-2026, 08:40 PM
Last Post: _Aka_
  Connections Between Opposing Splines lockiidraws 1 509 12-04-2025, 02:14 PM
Last Post: _Aka_
  Spawn at start/ end of splines rickgplus 4 2,770 03-21-2025, 12:34 PM
Last Post: _Aka_

Forum Jump: