Thanks for the code.
I have a start vector A(x,y,z) and a vector B(x,y,z).
All I need to do is to transform a cone into that start and end point.
I can allready build a cone, and I can also translate it in the space, but I don't know the
Here is some code, it works but not perfect. The angle fits not perfectly into the given vector points A and B.
var d = endPosition - startPosition;
var len = d.Length();
var k = new Vector3(0, 1, 0);
var a = (float) Math.Acos(Vector3.Dot(d, k) / (d.Length() * k.Length()));
var rot = Matrix.CreateFromAxisAngle(
new Vector3(0, 1, 0), d) / d.Length(), a);
var color = Color.Lerp(
len, (float)fMin, (float)fMax, 0f, 1f));
* Matrix.CreateScale(1f, len, 1f)
* Matrix.CreateTranslation(startPosition + (0.5f * d)),