Jump to content
Sign in to follow this  
blackandwhite

[Xpresso] - 2 point positions to matrix rotations

Recommended Posts

how to setup in Xpresso so that I can input 2 point positions and figure out what the angle of rotation is between two points. I was looking at matrix functions to do this -

 

http://en.wikipedia.org/wiki/Rotate_matrix

 

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?

Share this post


Link to post
Share on other sites

doesn't seem to quite work. I'm trying to make a rail style orientation control.

 

so the setup is like this here:

http://www.base80.co..._spline_xpresso

 

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

www.paraportable.net/files/AlightToSpline_Xpresso_RAIL.rar

 

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

Share this post


Link to post
Share on other sites

So you want to make your own AlignToSpline Tag with a rail spline function, right?

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.

 

Cheers

Lennart

Share this post


Link to post
Share on other sites

Thanks!

 

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.

 

www.paraportable.net/files/AlightToSpline_Xpresso_RAIL_V3.rar

Share this post


Link to post
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.

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.

Sign in to follow this  

×
×
  • Create New...