rotate pt A to match pt B

   1958   2   0
User Avatar
Member
1010 posts
Joined: April 2017
Offline
Hi!

I'm making a tool that takes 2 similar meshes but have completely different rotation/scale/translate (and topo) and have mesh A match mesh B. I'm good for scale and translate but I need help for rotation:

At this step, I have point A and point B (each coming from different nodes). Both have a normal and a vector pointing perpendicular to that normal. I would like to know how to align point A so it has the same normal and rotate around that N to have the perpendicular vector matching point B's.

If it's not clear, I'll add images later.

Thanks for any help!

-Olivier
Edited by olivierth - Sept. 24, 2018 20:09:56
User Avatar
Member
8582 posts
Joined: July 2007
Offline
assuming your NA, NB, upA, upB are normalized then the rotation matrix will be something like this
matrix3 rotAtoB = invert(maketransform(NA, upA)) * maketransform(NB, upB);
Tomas Slancik
FX Supervisor
Method Studios, NY
User Avatar
Member
1010 posts
Joined: April 2017
Offline
Great!

Thanks you.

Now, to learn matrices…

-Olivier
  • Quick Links