Adjust orientation of N along curveu

Recommended Posts

Hello guys,

could anyone help me achieve what I just draw? I used the OrientAlongCurve to orient my normals along my curve. Then I use the AttribRandomize with N as Direction Attribute in the parameters.

So far so good, I have the drawing on the left. I would like my normals at the bottom to be closer to my curve and the ones at the end more perpendicular. What should I do?

basically it is the Cone Angle parameter of the attribute randomize (set to Distribution Inside Sphere) that I would like to scale by curveu (I think this is what I have to do).

But how can I fetch a parameter and use it as an attribute in a wrangle or VOP. I probably don’t have to do this for my issue but this is something I was wondering how to do.

Thank you !

Share on other sites

You can use a ramp to control how much the normal is rotated by along the curve, see attached.

rotate_N_along_curve.hiplc

• 1

Share on other sites

wow, thank you. I am decrypting your code at the moment and trying to understand it.
So far, from my understanding is that you:
- create N along the curve
- create another N perpendicular to the curve
- create an axis from the cross product of those two different normals
- create an identity matrix
- rotate that identity matrix according to the position on the curve
- multiply N by this new rotation

Well, I think I get it, the only tricky thing is that identity matrix because I had not seen it before.

Thank you very much

Share on other sites

That is correct. The method used is from here, but I added the ramp functionality to give better control. Instead of using point number over total number of points, you can also use something like arclen() if your points are not evenly distributed on the curve.

Share on other sites

I found another way without using matrices (which seems to produce the same result, as far as I can see) by using the Attribute Transfer and the lerp() function between the two different normals:

float amount = chf('amount');
@curveu *= amount;
amount = chramp('ramp', @curveu);

v@N = lerp(v@N, v@N2, amount);

Edited by anbt

Share on other sites

almost the same. I can't rotate the normals completely around the axis (360*), but I can achieve the same result until a certain angle of rotation