[Xpresso] - 2 point positions to matrix rotations
Posted 23 May 2012 - 12:19 AM
not sure if it can be done in one node or if i need a few? I haven't seen any xpresso nodes yet which will output a rotation given 2 point positions of (x,y,z) vectors?
Posted 23 May 2012 - 12:47 AM
so the setup is like this here:
but instead of using tangent, which does orient pretty well but it can produce a flipping problem in certain cases I'd like to use a rail curve. so the setup would use another curve and another spline node to output a second position. then I need to find the vector or how the position from curve one points to the corresponding position on curve two.
here is my file setup
basically the output of the new matrix the one defined by the rail would go into the matrix2HPB and then that would pipe to the object rotation.
Edited by blackandwhite, 23 May 2012 - 12:52 AM.
Posted 23 May 2012 - 11:22 AM
Anything ToHPB will null the B and flip it.
You need to use the Cross Product of your tangent and the rail spline position
to determine the third axis.
I suck at Xpresso so I have no example to give, but check the Cross Product Node
and how to normalize the result.
Posted 23 May 2012 - 03:22 PM
I feel like I'm close to getting the proper output now. not quite what I need. from what I can tell I did what you said.
cross product of spline 1 tangent with position of rail spline 2 then universal node set to normal to normalize the result of that.
I hooked up the output from that into the rotation and it seems pretty close but its not identical to the way that align to spline tag works with rail input.
I have an xpresso setup here if anyone can dig in and figure out what the solution would be.
0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users