# Track to in animation nodes

I want the planes affected by the object fallof to rotate towards the origin of the sphere. Basically what would track to constraint do. Is there a way to achieve that?

I have tried converting sphere¨s direction to rotation but didnt get the result I wanted.

You can use a second Offset Matrix node with rotation mode to achieve the desired result.

The rotation itself is calculated with the Direction to Rotation node, like you assumed.
The direction has to be calculated from the already translated planes, otherwise the vectors would be incorrect. You can get them with a Decompose Matrix node from the first Offset Matrix.

I interpreted your question differently, so I'll post my answer too, though binweg's answer is probably what you're looking for.

If you want to rotate the planes along the z-axis, you can use a Math > Arctangent B/A node to get the correct rotation:

Download the .blend:

• Yes, binweg's solution was the one I was looking for, so I will accept his answer, but I'm giving you a vote too, since it answers my 'track to" question, even though in different way – Johan Apes May 31 '18 at 20:38
• Is blendgur the new blend-exchange? Which one should I use? – Leander May 31 '18 at 22:24
• @Leander Blendgur hosts blends by putting them inside .png images and uploading them as images to Stack Exchange. This has the advantage of relying on no external storage. Blend-Exchange on the other hand currently stores blends on Google Drive (however, that may change depending on whats cost effective). The downside of Blendgur using StackExchange's image upload is that AFAIK nobody has found out whether StackExchang and Imgur are actually okay with people doing this. If they give it the thumbs up we will add imgur storage to blend-exchange in addition to classic storage. – GiantCowFilms May 31 '18 at 23:21