Jump to content

*stuck* Rotation matrix between two vectors?


hopbin9

Recommended Posts

Hi,

In hscript there is the mlookat and mlookatup commands to compute a rotation between two vectors.

How can this be done in Python?

Right now, I'm doing something like this.

str_n = "vector3"+pNormal.__str__().replace("[","(").replace("]",")")

r1 = hou.Matrix4(hou.Matrix3(hou.hscriptExpression("mlookat("+str_n+",vector3(0,1,0))")))

But, there has to be a better way.

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