Reversed from the function that set the crosshair distance, here is the C# implementation of what it do exactly :
I'm sure it will be usefull for someone elseCode:float dx = X1 - X2; float dy = Y1 - Y2; float dz = Z1 - Z2; double distance = Math.Sqrt((double)((dx * dx) + (dy * dy) + (dz * dz))); distance = Math.Floor(distance); distance = Math.Ceiling(distance * 0.04);