Jump to content
Follyx

defining normal direction with wrangles

Recommended Posts

ok: a curve with i.e. 10 points.

I want to achieve that the normals of the curve are pointing to the next point on the curve. I want to realize it with a point wrangle node AND VOP's

I think thats an old problem but I didnt know how to search for it:-)

Thanks in advance

Share this post


Link to post
Share on other sites

PolyFrame works well in this situation, just change the tangent to 'N'. 

A vex solution would look like
 

if (@ptnum != npoints(0)-1)

    @N = @P - point(0, "P", @ptnum+1);

else

    @N = point(0, "P", @ptnum-1) - @P;
@N = normalize(@N);

.  This handles the case of the last point by inverting the vector towards the previous point. 

  • Like 1

Share this post


Link to post
Share on other sites

If you want to achieve that in VOP just subtract NextPointPosition and P, normalize result, and connect result to N. NextPointPosition you will get with ImportPointAttribute node whre you will feed in ptnum increased by one. Thath increment you will do for all points except last one. Anyway you didnt defined where last point normal should point to. Suppose you want last point normal to point to zero point then you can use conditional to detect such case (in example it is pointvop2)

CustomNormals.hip

 

edit:

@MrScienceOfficer, you were faster I didnt see you already reply

Edited by djiki
  • Like 1

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

×