Hello. I'm wondering about if there is a quick, robust and procedural way to take any arbitrary curve in space that has at least normals and up vector and based on that curve's first or last point, first move it to the origin and then rotate it so that the normal will point straight down the z-axis (the N of the first/last pt)? Alternatively use the orient attribute to do the rotation if available?
please see the attached image
thanks,
Dag
best way to "lock" an arbitrary curve to the origin?
348 2 1-
- Dougie0047
- Member
- 106 posts
- Joined:
- オフライン
-
- olivierth
- Member
- 1175 posts
- Joined: 4月 2017
- オフライン
Hi!
I usually use matrices to do this sort of thing. You already have 2 axis, you just need to create one more with a cross product. In a Detail Wrangle I used:
...right after the wrangle, you place a "Transform_by_Attribute" sop with "m". Make sur you activate the "Invert Transform".
I usually use matrices to do this sort of thing. You already have 2 axis, you just need to create one more with a cross product. In a Detail Wrangle I used:
vector y = point(0, "up", 0); vector z = point(0, "N", 0); vector x = normalize(cross(z, y)); // getting the perpendicular vector vector pos = point(0, "P", 0); matrix m = set(x, y, z, pos); setcomp(m, 0, 0, 3); // Making sur the last column has zeros setcomp(m, 0, 1, 3); // setcomp(m, 0, 2, 3); // 4@m = m;
...right after the wrangle, you place a "Transform_by_Attribute" sop with "m". Make sur you activate the "Invert Transform".
Edited by olivierth - 2025年11月18日 09:08:06
-
- Dougie0047
- Member
- 106 posts
- Joined:
- オフライン
-
- Quick Links


