Jump to content

How to find the quaternion to rotate from one vector to another


Recommended Posts

Hello!

 

I have a line bent along the x axis, and a series of points in a ring around it.  Is there a way for me to align the line to these point positions while making copies in a for loop?  Im trying to using the align vop in the point vop, along with some quaternion math.  My result is okay, but not good enough.  Please see attached!  Itll make more sense than any rambling I do here.

Thank you!

Modeling_Practice_v003_upl.hipnc

day4.PNG

day4_2.PNG

Link to comment
Share on other sites

7 hours ago, f1480187 said:

1. dihedral(). Be careful with opposite vectors. There are infinite number of rotations between +x and -x vectors. It will choose one arbitrarily. Which may result in the issues like in the picture posted.

2. Possible fix, without using quaternions and matrices: sweep_sections.hipnc

sweep_sections.png.0c798d27370db86dd435acbb4f7b59e1.png

 

Thank you very much f1480187.  

Im gonna look into dihedral() for my own mathematical purposes, but your alternative solution works perfectly.  Many thanks for your help!

 

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