Jump to content

How to capture Normals Rotate Value ?


ghang

Recommended Posts

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

Link to comment
Share on other sites

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 by jrgauthier
Link to comment
Share on other sites

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

Link to comment
Share on other sites

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!!!!

Link to comment
Share on other sites

  • 1 month later...

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...