Curve orientation to face certain direction

   2918   7   0
User Avatar
Member
77 posts
Joined: Oct. 2016
Offline
Hello there,

have bunch of absolutely random curves and using copytocurves to copy some geometry on it aligned to them. Problem is that I want them all face the origin in middle, but some of them are doing it and some look at opposite direction.

So far i managed to add them a cylindrical uv and sort the points based on it, which almost perfect except there is a 50% chance its going to be the wrong direction at the seam.

Any ideas? Many thanks!
User Avatar
Member
1618 posts
Joined: March 2009
Offline
If I understood you correctly, you can simply set the direction yourself, manually. The copy SOPs will respect @N, @up etc, so you simply construct @N to orient the copies. In your case, @P can be used, since you want to look at the origin, and @P is, technically, just a vector from the origin to your point. See attached scene file.

Attachments:
point_to_origin.hip (89.8 KB)

Martin Winkler
money man at Alarmstart Germany
User Avatar
Member
77 posts
Joined: Oct. 2016
Offline
Thanks fast response! This is cool method, used to use lookat vop but this is way easier! Thanks!

It is not exactly what i need this time though. My instances still have to align to the curves, not 100% face the origin. The normals have to be 90 degrees on the curves.
So have to make all the direction of of curves fit this scenario somehow.
Edited by blakshep - July 24, 2022 15:28:29

Attachments:
curvesaround.jpg (121.0 KB)

User Avatar
Member
731 posts
Joined: Dec. 2006
Offline
I have not had time to look at this particular example,, but the Orient Along Curve SOP works for most of this kind of stuff.
Sean Lewkiw
CG Supervisor
Machine FX - Cinesite MTL
User Avatar
Member
77 posts
Joined: Oct. 2016
Offline
Yes im using that but not sure how could control which direction would the tangents are facing on the curve.

In another similar issue i used have when generating closed curves sometimes tangents are looking inwards also not sure how could not manually fix that.
User Avatar
Member
474 posts
Joined: July 2005
Offline
You can modify the normals directly after you have placed the curves on the points using orientation (or whatever). If you don't want to modify the normals, it is probably impossible to orient the curves making the normals look at one direction, because the normals of two points can have opposite direction, which is untouched by translation and rotation.

Here is a file

Attachments:
normals_to_point_ortho.hipnc (178.3 KB)

User Avatar
Member
77 posts
Joined: Oct. 2016
Offline
Thanks for answer!
I guess im not explaining very good my curves are fixed and want to scatter on its tangents.
I just want to reverse the curve in case its facing to the wrong direction.
I guess i could reverse the normals by a checking on how close they are to the vector pointing to origin by some threshold?
User Avatar
Member
131 posts
Joined: Aug. 2012
Offline
Like this? @blakshep

Attachments:
align_N_using_centroid_P.hiplc (117.3 KB)

  • Quick Links