How can I draw a tube on basis of position and angle between two 3d points? I'm struggling with this idea of creating two particles in 3d and draw a tube between them. I can't figure out how to properly set the angle of the tube. I've used two approaches:


calculating the angle with the square root dot product divided by the length of the vectors.
cartesian to polar function which calculates the y and z rotation values


I'm obviously missing something (and I'm not that good in math). So what's my approach?

Thanks in advance! See below what I have so far.
The simplest solution is to use a lookat matrix. This is a matrix calculated from a "eye" point, a "target" point and an up vector.

The resulting matrix will then make the Z axis point from the eye to the target and the y axis in the general direction of up.