aligning normals

Recommended Posts

Please, how could I aligning normals on a spline to the next point, or point before. Is there a ready expression anywhere? I already figured the solution with point/oppoint out but I''m sure there are more solutions, arent it?

Thank you in advance.

Cheers

Share on other sites

Use the Polyframe sop node. change the tangent name to "N".

That is a know attribute in houdini for setting the normal attribute.

Share on other sites

cool great. Nevertheless I'm also in a scripted- or expression solution interested. Any Idea?

Share on other sites

For something like this you should have a look into vopsops

This allows you to create your own solution. There is also a script node that you can use.

And you can build your own nodes "Digital assets" If you go to File->New operator type.

Share on other sites

The idea is simple, you have to take the position of one point and subtract from the position of the previous pt. You can do with vops, just add a import attribute node, pick up the pt number from globals and subtract one. Then subtract the global position from the import attribute node, and plug it in the normal output.

You can do the same with expressions, just use a point() expression, use \$P as point number and grab the "P", 0 (first float from the vector "P" = x), then subtract the same expression, but with \$P -1 as point number. Do the same for y and z.

I´m new in python land, so I will have to search for the function, but the idea remains the same.

Share on other sites

cool, thanks a lot for your help

But as I'm still a bloody starter, would you mind to write me the expression down? so I'm sure to learn much more.

Edited by O.Heid
Share on other sites

use a point sop, "add normal", delete channels and use this expressions (HScript) on the normal's X Y and Z field. (by default there is standing \$NX, \$NY, and \$NZ). Replace it with this:

point("../" + opinput(".", 0), \$PT + 1, "P", 0) - \$TX

point("../" + opinput(".", 0), \$PT + 1, "P", 1) - \$TY

point("../" + opinput(".", 0), \$PT + 1, "P", 2) - \$TZ

Share on other sites

thanks a lot for this expression.

Share on other sites

Here is another very simple method. Shift the points with a sort sop then subtract one from the other. See attached.

WD

normals_follow_curve.hip

Share on other sites

@ woodenduck: also a really handy solution. Thanks a lot. Thats so strange for a beginner as me that there exist always a couple of solutions....

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

Only 75 emoji are allowed.

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×