Jump to content

Recommended Posts

Hello,

I'm working on a school project and I need to align a curve to the end of a line both in position and rotation. My goal is to be able to create a curve, anywhere in the scene, and snap the start of the said curve (point 0) to the end of the line. The end of the line is extracted with a carve node on the line itself, so nothing complicated here.

So far, I've been able to simply copy the curve onto the end of the line, but it only work with the position of the curve, not the rotation. It's important to note that I purposely created the curve in -Z axis. I know it will work if my curve is properly aligned in the Z axis, but I want my asset to be the most fail-safe possible.

That said, It would be very appreciated if someone could help me with this issue. There is a attachment showing my current network and what it looks like in the Scene View.

Thank you !

align_curve_line.JPG

Edited by anthonyblanchettepotvin
Forgot the attachment.

Share this post


Link to post
Share on other sites

Hi,

here is a quick and dirty approach using vex. You can draw your curve anywhere. The first vex node will make the curve x-axis aligned, so that the first and the last point are on the x axis and the end point is in point zero.

The second node will do a similar transformation (only reversed order) to make the curve match the lines start end end points.

curve_to_line.hipnc

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×