rotation between two vectors

   3829   3   2
User Avatar
Member
21 posts
Joined: 11月 2010
Offline
I must not be understanding something here. Why when I use this expression in the Z rotation channel of a transform SOP, does it return -45, when I am expecting it to return 90?

explodematrix(mlookat("“,”“), ”RST“, ”XYZ“, ”RZ")

I just want to rotate an object from one unit vector to another. Thanks for any tips!
User Avatar
Member
8833 posts
Joined: 7月 2007
Offline
if you want rotation matrix from one vector to another use dihedral()

so it'll be
explodematrix(dihedral("“,”“), ”RST“, ”XYZ“, ”RZ")
(as mlookat() and mlookatup() are for creating rotation matrix in direction from one vector to another with optional up vector, so in case you use them your first vector would ideally be for origin)
Tomas Slancik
FX Supervisor
Method Studios, NY
User Avatar
Member
21 posts
Joined: 11月 2010
Offline
tamte
use dihedral()

Much thanks Tomas!
User Avatar
Member
621 posts
Joined: 8月 2008
Offline
nice trick
  • Quick Links