anbt Posted June 19, 2021 Share Posted June 19, 2021 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 ! Quote Link to comment Share on other sites More sharing options...
Fenolis Posted June 21, 2021 Share Posted June 21, 2021 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 Quote Link to comment Share on other sites More sharing options...
anbt Posted June 21, 2021 Author Share Posted June 21, 2021 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 Quote Link to comment Share on other sites More sharing options...
Fenolis Posted June 22, 2021 Share Posted June 22, 2021 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. Quote Link to comment Share on other sites More sharing options...
anbt Posted June 22, 2021 Author Share Posted June 22, 2021 (edited) 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 June 22, 2021 by anbt Quote Link to comment Share on other sites More sharing options...
anbt Posted June 22, 2021 Author Share Posted June 22, 2021 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 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.