Curve orientation to face certain direction
2959 7 0- blakshep
- 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!
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!
- protozoan
- Member
- 1626 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.
Martin Winkler
money man at Alarmstart Germany
money man at Alarmstart Germany
- blakshep
- 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.
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
- mrCatfish
- Member
- 731 posts
- Joined: Dec. 2006
- Offline
- blakshep
- Member
- 77 posts
- Joined: Oct. 2016
- Offline
- Aizatulin
- Member
- 477 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
Here is a file
- blakshep
- 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?
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?
- Jikian
- Member
- 131 posts
- Joined: Aug. 2012
- Offline
-
- Quick Links