3D Line to connect two 3D Points
<p>I have two 3D Points (Spheres) and I want to draw a line connecting them using a 3D Line (thin Cylinder). I am implementing this using SceneKit. So far I am able to draw the 2 points in 3D space with the cylinder line. I also have the length of the line calculated from the two points. Now I am looking for the right transformation matrix that would rotate the line such that it connects the two points. </p>

<p>I am planning to abstract a function that would take any two points and draw a line:
<code>
<code>func lineFor(point1 point1: SCNVector3, point2: SCNVector3) -&gt; SCNNode</code> 
</code></p>

<p>Any help is appreciated</p>