Jump to content

object rotation from normal vector.


Recommended Posts

I have a point normal that I've extracted from a sequence of obj's dumped out of Maya (don't ask). I want to rotate an object in world space based on the direction of said normal. Currently, I'm barking up the tree involving orienting a matrix to the vector, then doing some sort of crackTransform()-ish operation to get the Euler angles. Problem is, I can't figure out how to get what out of where at which point. This is turning into a No play, makeup and all. Is there some dirt-simple way to do this that I've just missed out on because I spent eight years using Houdini as a front end to a proprietary volume renderer, then another two and a half using it as a front end to the Lighting department?

The only other thing I can think of (and my wrist is already swelling at the prospect) is to do point() and lookat() functions in the object's T and R channels.

Cheers

Link to comment
Share on other sites

Could you be more specific (about what is not working) or possibly attach simply hip file for an explanation what you're after?

I'm not sure if I understand correctly your problem.

Edited by SYmek
Link to comment
Share on other sites

Could you be more specific (about what is not working) or possibly attach simply hip file for an explanation what you're after?

I'm not sure if I understand correctly your problem.

Simply put, I need to generate Euler rotation angles from a direction vector. I just found the 'vector to rotation' sop here, but I think that's an in-house tool.

Link to comment
Share on other sites

Take a look at the dihedral() expression function. Note that you need TWO vectors in order to describe the rotation. One of them is which ever axis you want to rotate from (eg. Z-axis) and the other vector is your normal.

Link to comment
Share on other sites

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