Forum

Create Transform from two Vectors

Hi,

so I read tonfilms excellent article on 3d mathematics, but I still can’t figure this one out:

I am dropping an ODE Box onto an ODE Plane. The Body (ODE) node tells me two vectors, the position of the box and its velocity (positional, not angular). I would like to convert these two vectors into a matrix transformation that points from the center of the box towards the direction it is heading. I want to feed this transformation into an Intersect (3D) node, to visualize where the box will (approximately) hit the plane.

I really can’t wrap my mind around it, and the problem is too abstract for me to solve by wild patching. I’ve attached the patch; could you give me a hint on what to do?

ode_test.zip (4.5 kB)

if you just need the direction you can use Polar (3d) to get the angles and connected them to a rotation transform node…

Thank you!

I got it to work:

http://www-stud.uni-due.de/~sj0500/test1img.jpg

It just needed some additional persuasion to face into the right direction: +.25x and -.25z rotation:

http://www-stud.uni-due.de/~sj0500/test1.jpg

Is this the way it’s meant to be, or a dirty hack ;) ?