Tomoka Posted November 28 Share Posted November 28 (edited) Hi, I’m currently working in Houdini and trying to rotate a non-perpendicular primitive to align it with the X-axis. In the second image, I used a Transform node and manually adjusted the rotation to achieve the alignment. Is there a procedural or more accurate way to achieve this? Any tips, improvements, or alternative approaches would be greatly appreciated. Thank you! Edited November 28 by Tomoka Quote Link to comment Share on other sites More sharing options...
toadstorm Posted November 28 Share Posted November 28 given two points on the long edge of the rectangle, let's say they're point 0 and 1: vector p0 = point(0, "P", 0); vector p1 = point(0, "P", 1); vector n = normalize(p0 - p1); // compute matrix that rotates the normalized edge onto +X matrix3 d = dihedral(n, {1,0,0}); // transform points with this rotation @P *= d; 2 2 Quote Link to comment Share on other sites More sharing options...
Tomoka Posted Sunday at 06:22 AM Author Share Posted Sunday at 06:22 AM It worked! Thank you so much! 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.