ghang Posted October 1, 2009 Share Posted October 1, 2009 Hi, I am doing something that really need this assistant I have a normals that have in different location different angel with $F and now I need to capture the normals Rotation angel in XYZ to use in a Transform SOP rotate. I have try point("../",0,"R",0) but it seems wasn't the expression function I need. I need to put the Normals Rotate Value to RxRyRz but not TxTyTz. Please Help me Thanks normal_rotation.hipnc Quote Link to comment Share on other sites More sharing options...
Owl Posted October 1, 2009 Share Posted October 1, 2009 i'm not sure i understand your problem, but if i'm right - this might help normal_rotation2.hipnc Quote Link to comment Share on other sites More sharing options...
jrgauthier Posted October 1, 2009 Share Posted October 1, 2009 (edited) Hi Owl! I just watched your file, I'm also really interested in the subject. Is it possible to do this without the use of a copy sop? Only with expressions for instance, because it works if you want to copy an object but, I had a case in where I wanted to align a texture projection to an object normal automatically and of your course a texture projection cannot be copyed... Edited October 2, 2009 by jrgauthier Quote Link to comment Share on other sites More sharing options...
Mario Marengo Posted October 1, 2009 Share Posted October 1, 2009 I have try point("../",0,"R",0) but it seems wasn't the expression function I need. I need to put the Normals Rotate Value to RxRyRz but not TxTyTz. Please Help me I think you're looking for the dihedral() and explodematrix() expression functions: /obj -> exhelp dihedral matrix dihedral (vector v0, vector v1) Computes the dihedral matrix between vectors v0 and v1. This returns a rotation matrix which will rotate vector v0 to vector v1. ---- /obj -> exhelp explodematrix float explodematrix (matrix mat, string trs, string xyz, string component) Explodes a 3x3 or 4x4 matrix into the euler rotations required to rebuild it. The returned components can be stuffed directly into Houdini rotation, scale, and translate channels. If you know the pivot point for the transformation, you may want to use the explodematrixp function instead. <mat> is the matrix to transform. <trs> and <xyz> give the order of the expansion. In trs, a "t" represents translation, "r" rotation, and "s" scale. The xyz refers to the order of the rotations. The component is a string describing which channel to extract. It is "[trs][xyz]" (e.g. "tx" or "ry"), where the t, r, or s chooses the channel (translate, rotate, or scale), and the x, y, or z chooses the axis. Not meant as a replacement for the CopySop, as it only extracts rotations (relative to +Z in the attached example), but I think this is what you're looking for: normal_rotation_mgm.hipnc Quote Link to comment Share on other sites More sharing options...
jrgauthier Posted October 2, 2009 Share Posted October 2, 2009 Wow!! Personally, even thought this is not a thread I started, this is exactly what I've been looking for! This is awesome! However I'm not sure to understand exactly how the expression works, I mean I'm reading the help, but I barely understand 1 word out of 2... Anyways, thanks alot Mario!!!! Quote Link to comment Share on other sites More sharing options...
ghang Posted November 8, 2009 Author Share Posted November 8, 2009 oh ya thanks too , the expression is exactly what i need. 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.