mic Posted January 23, 2009 Share Posted January 23, 2009 hello! tell me please how can i align the object to the single point with normal?. for example, i have grid with all normals up and i want rotate it so it normals are equal to the normal of some point. i tried Align SOP , copy SOP, sweep SOP.. Quote Link to comment Share on other sites More sharing options...
SpencerL Posted January 23, 2009 Share Posted January 23, 2009 hello! tell me please how can i align the object to the single point with normal?. for example, i have grid with all normals up and i want rotate it so it normals are equal to the normal of some point. i tried Align SOP , copy SOP, sweep SOP.. use a point SOP on your grid. Then in your normals parameter use a point() expression in X, Y, Z respectively. I use "10" as the point number. Just replace that with whatever point you want the normals to match. point("../myPoint", 10, "N", 0), point("../myPoint", 10, "N", 1), point("../myPoint", 10, "N", 2) Quote Link to comment Share on other sites More sharing options...
mic Posted January 23, 2009 Author Share Posted January 23, 2009 use a point SOP on your grid. Then in your normals parameter use a point() expression in X, Y, Z respectively. I use "10" as the point number. Just replace that with whatever point you want the normals to match. point("../myPoint", 10, "N", 0), point("../myPoint", 10, "N", 1), point("../myPoint", 10, "N", 2) no, i want rotate the grid not the grid's only normals! the solution is to convert the direction (normal) to rotation vector (rotation matrix), but maybe some SOP can do it, without writing expressions or VOP SOP? Quote Link to comment Share on other sites More sharing options...
Guest Swann Posted January 24, 2009 Share Posted January 24, 2009 (edited) This is what you want ? Don't know the way without expressions. Sadly second posibility I know is with VOP SOP. The biggest fun with Houdini is that you can use expressions everywhere. Later you can make your own asset that will make this. EDIT: Never mind, I just found problem with my method. Edited January 24, 2009 by SWANN Quote Link to comment Share on other sites More sharing options...
Guest Swann Posted January 24, 2009 Share Posted January 24, 2009 (edited) Ok. Solved. Yellow nodes are only to help visualize. EDIT: Actualy you need only four nodes that are in red box on picture. rotate_grid_with_point_normal.hipnc Edited January 24, 2009 by SWANN Quote Link to comment Share on other sites More sharing options...
mic Posted January 24, 2009 Author Share Posted January 24, 2009 (edited) Ok. Solved. Yellow nodes are only to help visualize.EDIT: Actualy you need only four nodes that are in red box on picture. thank you very much, SWANN! (the math solution wasn't very simple: N1 - first normal, (of grid) - we know N2 - final normal, (of point) - we know Rxyz - rotation matrix , N2 = Rxyz*N1, the alpha, beta, gamma(rx, ry,rz) we must find. three equations with sin and cos) not very simple math for expressions)) Edited January 24, 2009 by mic Quote Link to comment Share on other sites More sharing options...
Guest Swann Posted January 24, 2009 Share Posted January 24, 2009 (edited) thank you very much, SWANN! (the math solution wasn't very simple: N1 - first normal, (of grid) - we know N2 - final normal, (of point) - we know Rxyz - rotation matrix , N2 = Rxyz*N1, the alpha, beta, gamma(rx, ry,rz) we must find. three equations with sin and cos) not very simple math for expressions)) But propably it wil have better results. Metod posted by me gives good results but around zero it makes grid rotation that I don't like. Edited January 24, 2009 by SWANN Quote Link to comment Share on other sites More sharing options...
mic Posted January 24, 2009 Author Share Posted January 24, 2009 But propably it wil have better results. Metod posted by me gives good results but around zero it makes grid rotation that I don't like. another solution i found: xform axis SOP: scale = 0, recompute normals = 0, direction = N from point by the way, invert transformation gives us perpendicular.. and the equations weren't so complex as i thought at first.. using tangents and projections two angles can be found. 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.